You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not totally clear why this wasn't being caught by integration tests but we should have some simple integration test that would catch #498. I guess there's nothing currently checking the header field hashes or even the hash of the header itself based on the block data? It's a bit of block validation functionality which we don't really have yet but we should start with enough to catch this so at least our Merkle tree is being tested in real context of being in a block.
The bug was fixed in #557 and has a unit test but no block-level test.
The text was updated successfully, but these errors were encountered:
Jumping on this now. Just to be sure (because we use the term "integration test" interchangeably with "conformance test" sometimes), you mean tests like here? @ebuchman
Right, so we could just fetch a block from the RPC and based on the data in the block, recompute the data_hash field of the header ourselves (ie. merkle root of the transactions) and check that it matches. Since we're not sending txs, blocks will be empty, so we can check that we compute the right merkle root when there are no txs. That should be sufficient to capture this.
Proper follow up would include a few different scenarios, like blocks with with 0, 1, 2, 5 transactions or something, but we'd have to do more work to create them. And ultimately we'd want tests that check all fields in the header against the block and other state, but we don't need to worry about that for now.
Not totally clear why this wasn't being caught by integration tests but we should have some simple integration test that would catch #498. I guess there's nothing currently checking the header field hashes or even the hash of the header itself based on the block data? It's a bit of block validation functionality which we don't really have yet but we should start with enough to catch this so at least our Merkle tree is being tested in real context of being in a block.
The bug was fixed in #557 and has a unit test but no block-level test.
The text was updated successfully, but these errors were encountered: