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): lower top tier proof cost #14922

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Oct 9, 2023

The goal is to make the muti-sig based guardian prover's cost to be as small as possible. We now config the number of blocks to verify after each proveBlock tranaction inside the tier config, instead of using a global config for all tiers.

@dantaik dantaik requested a review from adaki2004 October 9, 2023 06:17
@vercel
Copy link

vercel bot commented Oct 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bridge-ui-v2-a5 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2023 6:18am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
bridge-ui-v2-internal ⬜️ Ignored (Inspect) Oct 9, 2023 6:18am

@davidtaikocha davidtaikocha changed the title feat(protoocl): lower top tier proof cost feat(protocol): lower top tier proof cost Oct 9, 2023
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #14922 (eb18c46) into contestable-zkrollup (4c78ddb) will increase coverage by 0.03%.
The diff coverage is n/a.

@@                   Coverage Diff                    @@
##           contestable-zkrollup   #14922      +/-   ##
========================================================
+ Coverage                 38.66%   38.70%   +0.03%     
========================================================
  Files                       114      114              
  Lines                      5434     5434              
  Branches                    113      113              
========================================================
+ Hits                       2101     2103       +2     
+ Misses                     3197     3195       -2     
  Partials                    136      136              
Flag Coverage Δ *Carryforward flag
bridge-ui 93.94% <ø> (ø) Carriedforward from 4c78ddb
eventindexer 18.30% <ø> (ø)
relayer 42.86% <ø> (+0.11%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

see 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@adaki2004
Copy link
Contributor

adaki2004 commented Oct 9, 2023

The goal is to make the muti-sig based guardian prover's cost to be as small as possible. We now config the number of blocks to verify after each proveBlock tranaction inside the tier config, instead of using a global config for all tiers.

Logic wise LGTM, but i have one other concern.

This introduces extra variable + some logic which ( at first glance seems not significant but) results in +10% on average and +27% in median proveBlock() transactions which seems a bit of a high price to make multi-sig guardian calls cheaper - and hopefully those guardians shall be rare - while the regular users pay more.

base branch gas tests:
kép

this one:
kép

@dantaik
Copy link
Contributor Author

dantaik commented Oct 9, 2023

@adaki2004 in our test, we used OptimisticRollupConfigProvider.sol as the ITierProvider, and you can see, in this file, the maxBlocksToVerify is not always zero, that's why the gas is increased for some blocks; where in previous code, the max number to verify is set to zero.

If I change this provider to always return 0 for maxBlockToVerify:
Screenshot 2023-10-09 at 16 47 56

Then I get this:
Screenshot 2023-10-09 at 16 48 19

As you can see the gas changes is fairly small.

@adaki2004 adaki2004 merged commit 49efd75 into contestable-zkrollup Oct 9, 2023
@adaki2004 adaki2004 deleted the top_tier_proof_no_verification branch October 9, 2023 09: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.

4 participants