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

feat: only bridge newly created contracts #1559

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

KolbyML
Copy link
Member

@KolbyML KolbyML commented Oct 28, 2024

What was wrong?

We would always bridge contracts, which isn't good because the contract should already be gossiped on the network. This takes up a lot of bridge bandwidth, which is redundant as the contracts should already be on the network.

How was it fixed?

By using a cache to store newly created contracts like we do for storage_trie diffs.

@KolbyML KolbyML requested a review from morph-dev October 28, 2024 00:06
@KolbyML KolbyML self-assigned this Oct 28, 2024
Copy link
Collaborator

@morph-dev morph-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Add reference to #1396 and close it once it's merged.

@@ -102,6 +106,15 @@ impl EvmDB {
trie_diff
}

pub fn get_newly_created_contract_if_available(&self, code_hash: B256) -> Option<Bytecode> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think that get_newly_created_contract is clear enough in this case. Up to you.

@KolbyML KolbyML force-pushed the only-gossip-newly-created-contracts branch from 26bb524 to 2f56ff4 Compare October 28, 2024 19:01
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be here. I assume you rebased to master, but didn't handle submodules correctly.
I don't know why all tests are still passing, so I could be wrong.

Just wanted to highlight it, so you can double check what is happening.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't rebase that is an artifact from me switching from master

@KolbyML KolbyML force-pushed the only-gossip-newly-created-contracts branch from 2f56ff4 to 042c3be Compare October 28, 2024 21:58
@KolbyML KolbyML merged commit 3ad7fe0 into ethereum:master Oct 28, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants