ethereum / trin

An Ethereum portal client: a json-rpc server with nearly instant sync, and low CPU & storage usage
365 stars 113 forks source link

fix: gossip state from trie diff and gossip every intermediate node #1316

Closed KolbyML closed 3 months ago

KolbyML commented 3 months ago

What was wrong?

fixes https://github.com/ethereum/trin/issues/1292

Calling get proof on all changed accounts missing changed intermediate trie nodes

recursive gossip doesn't work so we have to gossip proofs for every intermediate try node

How was it fixed?

This PR gossips every intermediate node (as from the summit we discussed recursive gossip doesn't work)

This PR also makes it so we don't miss a changed node, by utilizing a Trie Diff

By getting the Trie diff from eth-trie.rs

Then by walking the diff building back traces then iterating over all the intermediate trie keys and building proofs to gossip

KolbyML commented 3 months ago

@morph-dev ready for another look, let me know if I missed anything

KolbyML commented 3 months ago

Sounds good I will look into the feedback when I clean up my database PR and prepare it for review