-
Notifications
You must be signed in to change notification settings - Fork 122
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
[Protocol3] Batched proof verification #283
Conversation
# Conflicts: # packages/loopring_v3/ABI/version30/IExchange.abi # packages/loopring_v3/contracts/iface/IExchange.sol # packages/loopring_v3/test/testExchangeBlocks.ts
# Conflicts: # packages/lightcone_v2.js/src/lib/wallet/ethereum/walletAccount.ts # packages/lightcone_v2.js/src/sign/exchange.ts # packages/lightcone_v2.js/src/wallet/metaMask.ts
@dong77 Ready for review. Unfortunately this PR has an extremely messy diff because of the automatic formatting that is now done when committing. |
@Brechtpd no worries. @letsgoustc and myself will probably need a week to review this PR. Please be patient. |
require(circuit.enabled == true, "ALREADY_DISABLED"); | ||
circuit.enabled = false; | ||
|
||
emit CircuitDisabled(blockType, onchainDataAvailability, blockSize, blockVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break into multiple lines.
circuit.registered = true; | ||
circuit.enabled = true; | ||
|
||
emit CircuitRegistered(blockType, onchainDataAvailability, blockSize, blockVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break into multiple lines.
ExchangeData.State storage S, | ||
uint blockIdx, | ||
uint256[8] memory proof | ||
uint[] memory blockIndices, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check the max length of blockIndies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no hard limit (except for the Ethereum gas limit/block). There's also a good chance verifying a proof will get even cheaper in Istanbul so it's up to the operator to decide how many proofs can be successfully verified.
Reduces the cost of verifying a proof from 550,000 gas/proof to about 200,000 gas/proof.