Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WS2 - Order book management code fails checksum audit #106

Open
1 of 4 tasks
casper opened this issue Jan 7, 2024 · 0 comments
Open
1 of 4 tasks

WS2 - Order book management code fails checksum audit #106

casper opened this issue Jan 7, 2024 · 0 comments

Comments

@casper
Copy link

casper commented Jan 7, 2024

Issue type

  • bug
  • missing functionality
  • performance
  • feature request

Brief description

When running the order_book_checksums.rb code in the examples/ws/v2 folder with :checksum_audit => true, the logger will frequently report checksum mismatch.

Something is not working properly with the internal order book management code.

Steps to reproduce

Run this slightly modified order_book_checksums.rb code, which will quickly highlight the bug:

require_relative '../../../lib/bitfinex.rb'

client = Bitfinex::WSv2.new({
  :url => ENV['WS_URL'],
  :manage_order_books => true,
  :checksum_audit     => true
})

client.on(:order_book) do |sym, msg|
  p "recv order book message for symbol #{sym}"
  p msg
end

client.on(:open) do
  client.subscribe_order_book('fUSD', 'P4', '25')
end

client.on(:checksum) do |sym, msg|
  puts
  puts "CHECKSUM"
  pp msg
  puts
end

client.on(:error) do |err|
  pp err
  exit
end

client.open!
Additional Notes:

Example output when running the above code:

...
CHECKSUM
[323049, "cs", -1108044634]

E, [2024-01-07T22:08:50.997911 #16770] ERROR -- ws2: OB checksum mismatch, have -961054908 want -1108044634 [fUSD
"OB checksum mismatch, have -961054908 want -1108044634 [fUSD"
I, [2024-01-07T22:08:50.998627 #16770]  INFO -- ws2: client closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant