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

refactor(protocol): split oracle proving into a function #13552

Merged
merged 21 commits into from
Apr 6, 2023

Conversation

dong77
Copy link
Contributor

@dong77 dong77 commented Apr 6, 2023

This PR allows the oracle prover to batch-prove multiple blocks in one L1 transaction to save cost. These are the following benefits:

  • Now the call data is minimized to reduce cost.
  • A block can be oracle-proven multiple times. In case the oracle prover makes a mistake, he can redo the proving with different hashes.

@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Merging #13552 (a99b05a) into major_protocol_upgrade_rebase (702ddd8) will decrease coverage by 0.36%.
The diff coverage is 0.00%.

@@                        Coverage Diff                        @@
##           major_protocol_upgrade_rebase   #13552      +/-   ##
=================================================================
- Coverage                          39.21%   38.85%   -0.36%     
=================================================================
  Files                                113      113              
  Lines                               3445     3464      +19     
  Branches                             392      399       +7     
=================================================================
- Hits                                1351     1346       -5     
- Misses                              2005     2029      +24     
  Partials                              89       89              
Flag Coverage Δ *Carryforward flag
bridge-ui 94.20% <ø> (ø) Carriedforward from 2bd2b2d
eventindexer ∅ <ø> (∅) Carriedforward from 2bd2b2d
protocol 0.00% <0.00%> (ø)
relayer 62.39% <ø> (-0.17%) ⬇️ Carriedforward from 2bd2b2d
ui 100.00% <ø> (ø) Carriedforward from 2bd2b2d

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

Impacted Files Coverage Δ
packages/protocol/contracts/L1/TaikoL1.sol 0.00% <0.00%> (ø)
packages/protocol/contracts/L1/libs/LibProving.sol 0.00% <0.00%> (ø)
packages/protocol/contracts/L2/TaikoL2.sol 0.00% <ø> (ø)

... and 3 files with indirect coverage changes

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

state.forkChoiceIds[id][oracle.parentHash] = fcId;
} else {
fc = blk.forkChoices[fcId];
if (fc.prover != address(0)) revert L1_ALREADY_PROVEN();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe still allow overwriting even when already proven by another prover? Only possible when ZKPs are incomplete/buggy, but we're likely to need something that'll allow us to do this somehow.

@cyberhorsey cyberhorsey merged commit f2ef668 into major_protocol_upgrade_rebase Apr 6, 2023
@cyberhorsey cyberhorsey deleted the oracle_proving branch April 6, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants