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): major protocol upgrade #13225

Merged
merged 106 commits into from
Mar 4, 2023

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Feb 28, 2023

Major Changes:

  • remove commit-and-propose scheme
  • txListProof must be part of the block proposal but it is not verified when a block is proposed. The main zk-proof must also include the txListProof circuit.
  • invalid blocks are proven by running the zk-verifier for block's txListProofs and such verification must fail (invalidatedBlock function is deleted from TaikoL2.sol)
  • the anchor transaction validation is deleted from L1 and shall be done by a new circuit on top of the existing ZKP.
  • synchronize not only the block header hashes across chains, but also the SignalServcie Storage Roots (signalRoot) -- Currently to prove signal's validity on the destination chain, we need to provide a full merkle proof which has two parts, the account proof and the storage proof. After this change, the account proof will be done only once in circuits. Users only need to provide the storage merkle proof, which will be less expensive.

Other Changes:

  • do NOT refund the proposer if the block is invalid
  • call plonk verifiers directly from LibProving by removing IProofVerifier contracts
  • use string.concat and bytes.concat instead of abi.encodePacked/abi.encode
  • delete a few unused libraries
  • disable a lot of protocol tests based on Dave's comment (probably need rewrite)

As you can see, the protocol is greatly simplified.

@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Merging #13225 (748d42d) into main (72d152b) will increase coverage by 0.44%.
The diff coverage is 19.76%.

@@            Coverage Diff             @@
##             main   #13225      +/-   ##
==========================================
+ Coverage   61.50%   61.94%   +0.44%     
==========================================
  Files         117      107      -10     
  Lines        3460     3072     -388     
  Branches      485      373     -112     
==========================================
- Hits         2128     1903     -225     
+ Misses       1249     1086     -163     
  Partials       83       83              
Flag Coverage Δ *Carryforward flag
bridge-ui 93.80% <ø> (ø) Carriedforward from 78ad1ff
protocol 50.53% <19.76%> (-1.62%) ⬇️
relayer 65.18% <ø> (ø) Carriedforward from 78ad1ff
ui 100.00% <ø> (ø) Carriedforward from 78ad1ff

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

Impacted Files Coverage Δ
packages/protocol/contracts/L1/TaikoConfig.sol 0.00% <ø> (ø)
packages/protocol/contracts/L1/TaikoToken.sol 85.00% <ø> (ø)
packages/protocol/contracts/L1/libs/LibProving.sol 0.00% <0.00%> (ø)
packages/protocol/contracts/L2/TaikoL2.sol 0.00% <0.00%> (-53.85%) ⬇️
packages/protocol/contracts/bridge/Bridge.sol 41.17% <ø> (ø)
packages/protocol/contracts/bridge/TokenVault.sol 51.08% <ø> (ø)
...s/protocol/contracts/bridge/libs/LibBridgeData.sol 100.00% <ø> (ø)
...protocol/contracts/bridge/libs/LibBridgeInvoke.sol 100.00% <ø> (ø)
...rotocol/contracts/bridge/libs/LibBridgeProcess.sol 19.04% <0.00%> (-2.58%) ⬇️
...rotocol/contracts/bridge/libs/LibBridgeRelease.sol 0.00% <ø> (ø)
... and 25 more

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

@dantaik dantaik changed the title feat(protocol): use circuit to validate anchor tx and introduce txListProof feat(protocol): major protocol upgrade Mar 4, 2023
@dantaik dantaik changed the base branch from main to major_protocol_upgrade March 4, 2023 08:05
@dantaik dantaik merged commit 16ea89e into major_protocol_upgrade Mar 4, 2023
@dantaik dantaik deleted the prove_anchor_tx_in_zkp branch March 4, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants