Snap server GetTrieNodes to return empty bytes when trienode doesn't exist#7305
Conversation
…xist Signed-off-by: Jason Frame <jason.frame@consensys.net>
…_nonexisting_node
|
we already did a modification for that on main https://github.com/hyperledger/besu/blob/main/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServer.java#L519 |
|
I think only this one is still needed https://github.com/hyperledger/besu/pull/7305/files#diff-e919e276e0dad67624dfc3a5e37c4e7f5369c9b7301f49e32bc6db3b4a062f44R532 |
Do you mean it will change the way empty accounts ranges are received by BFT nodes? |
I was thinking how we manage the case where we ask for an account that does not exist and server is returning nothing but maybe it's just a normal case and we should never ask for an account that does not exist. maybe it will not impact you. |
That was a slightly different case specific to when there was no account and an empty location. This is a more general case and applies whenever we have no account or storage trienode. |
It could do as I am changing logic around the handling of nodes that aren't found. Could possibly break snapsync for BFT in the empty state case. Currently testing the BFT snapsync with the PR at the moment. |
Agree that EMPTY_TRIE_NODE makes more sense but the snapsync hive tests are expecting empty https://github.com/ethereum/go-ethereum/blob/master/cmd/devp2p/internal/ethtest/snap.go#L665 so I think this is correct. If I change it to use EMPTY_TRIE_NODE instead of empty it fails the hive tests. I traced through Geth and when a node isn't found nil is returned and included in the response. |
OK, thanks for the clarification. I'm not able to do much this week while at EthCC but I can try some of my tests on Monday. The basic scenario I used as a guide was running 3 full-sync nodes with snap-server enabled, then sync a 4th node with snap-sync (with no accounts on the chain so far) and that showed up the original issues with empty account ranges. With the change you're suggesting, will |
Thanks I've tested that scenario and broke with my changes and without your changes. So will keep working on this PR till I get that scenario working.
I think the empty response might need to be handled differently in the |
…e response changes Signed-off-by: Jason Frame <jason.frame@consensys.net>
…_nonexisting_node
…he location is also empty to handle snap syncing with empty state Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
|
@matthew1001 I've made changes to handle empty bytes and it's now working with the 4-node BFT test scenario. Could you have a look when you have a chance? |
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
…e for empty account with account trie path Signed-off-by: Jason Frame <jason.frame@consensys.net>
|
Updated PR to BFT snap changes @garyschulte @matkt |
Sorry I didn't get time to try these changes out yet @jframe but I'm going to be doing a bunch with BFT/snap while working on Bonsai archive so I'll shout if I see any issues. |
…exist (besu-eth#7305) Signed-off-by: Jason Frame <jason.frame@consensys.net> Signed-off-by: gconnect <agatevureglory@gmail.com>
PR description
Snap server GetTrieNodes request to return empty bytes instead of ending the request when the trienode doesn't exist. This matches the behaviour of Geth and fixes the remaining failing tests with Hive GetTrieNodes.
Also changed to end the request when the account doesn't exist for retrieving storage to match Geth's behaviour and fix a test.
Testing
Snap synced Geth node against Besu as a snap server with this PR
Fixed Issue(s)
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests