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(protocol): show my idea of reducing 1 sstore in libproving #17533

Closed
wants to merge 29 commits into from

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Jun 8, 2024

Currently each provingBlock tx have 6 sstore ops. This PR shows my idea to reduce it to almost 5.

The idea is that we only write stateRoot once every 32 blocks for cross-chain bridging synchronisation. This means when the ring-buffer is reused, we can use 4700 less gas, a ~2.5% reduction.

The downside of this change is that blockHash in events will not always be the block hash, sometimes it's the hash of blockhash and stateroot.

So is it worth it?

@dantaik dantaik requested review from cyberhorsey, Brechtpd, adaki2004 and davidtaikocha and removed request for cyberhorsey June 8, 2024 13:53
Copy link

openzeppelin-code bot commented Jun 8, 2024

feat(protocol): show my idea of reducing 1 sstore in libproving

Generated at commit: 131b140fa5b0ac050685ccaf79e53e242fbdce98

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
8
42
54
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@dantaik dantaik changed the base branch from main to optimize_proving_writes June 9, 2024 08:13
@dantaik dantaik closed this Jun 9, 2024
@dantaik dantaik reopened this Jun 10, 2024
Base automatically changed from optimize_proving_writes to main June 12, 2024 03:58
@dantaik dantaik closed this Jun 12, 2024
@dantaik dantaik deleted the show_idea_to_optimize_proving_cost branch June 12, 2024 20:57
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.

None yet

2 participants