ethereum / trin

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

Smart Contract's bytecode is gossiped every time balance or storage is updated. #1396

Open morph-dev opened 2 weeks ago

morph-dev commented 2 weeks ago

Currently, we will try to gossip Smart Contract's code even if it is not modified. If contract's balance or storage was updated, entire AccountState (and leaf in the account trie) will be updated as well.

The following code would then gossip bytecode as well: https://github.com/ethereum/trin/blob/3fc0ed81fc165961f8c587a95fb5de66a9df7b7e/portal-bridge/src/bridge/state.rs#L180-L191

I'm not sure if there is easy way for this to be fixed.

KolbyML commented 2 weeks ago

I don't think this is a milestone for devcon 2024

KolbyML commented 2 weeks ago

Just in case someone wanted to work on this, https://github.com/ethereum/trin/pull/1337 this PR should be merged first as it would invalidate the work from this PR.

I think in the grand scheme of things there is a lot that should be done before this issue though

morph-dev commented 2 weeks ago

I don't think this is a milestone for devcon 2024

While I think it's not critical for the devcon and there are other important issue, I think we should have this if we want to gossip head blocks (because there will be a lot of contracts that are touched at every block).

100% there is just a lot to do before we reach that, lot being relative