-
Notifications
You must be signed in to change notification settings - Fork 376
Draft: Initial version for precommits & role-based validator timelock #1461
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
base: draft-v29
Are you sure you want to change the base?
Conversation
l1-contracts/contracts/state-transition/chain-deps/ZKChainStorage.sol
Outdated
Show resolved
Hide resolved
|
||
let currentCommitment := mload(TXS_STATUS_ROLLING_HASH_BEGIN_BYTE()) | ||
|
||
mstore(0, txHash) |
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.
is it safe to write to this memory address?
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.
yes, by this point in code, everything up to SCRATCH_SPACE_SLOTS + SCRATCH_SPACE_BEGIN_SLOT is safe to write to
error InvalidBatchNumber(uint256 provided, uint256 expected); | ||
|
||
error EmptyPrecommitData(uint256 batchNumber); | ||
|
||
error PrecommitmentMismatch(uint256 batchNumber, bytes32 expected, bytes32 found); | ||
|
||
error RoleAccessDenied(uint256 chainId, bytes32 role, address account); | ||
|
||
error DefaultAdminTransferNotAllowed(); | ||
|
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.
Error selectors missing here.
l1-contracts/contracts/state-transition/AccessControlEnumerablePerChainUpgradeable.sol
Outdated
Show resolved
Hide resolved
l1-contracts/contracts/state-transition/chain-deps/facets/Executor.sol
Outdated
Show resolved
Hide resolved
l1-contracts/contracts/state-transition/chain-interfaces/IExecutor.sol
Outdated
Show resolved
Hide resolved
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.
Sharing a high-level review
l1-contracts/contracts/state-transition/AccessControlEnumerablePerChainUpgradeable.sol
Outdated
Show resolved
Hide resolved
@@ -174,4 +174,6 @@ struct ZKChainStorage { | |||
/// @notice Bytecode hash of evm emulator. | |||
/// @dev Used as an input to zkp-circuit. | |||
bytes32 l2EvmEmulatorBytecodeHash; | |||
/// todo | |||
mapping (uint256 batchNumber => bytes32 precommitemnt) batchPrecommitments; |
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.
What do you think about other names? How about checkpoints?
I see that precommitments make sense because they go before the commit thus pre commitments. But the word commit might be misleading. A cryptographic commitment (commit-reveal) implies that it's not possible to change the value once committed. In our case that's not completely true as batches can be reverted.
This is more of an open discussion. I don't have a strong opinion in this particular case.
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.
IMO precommitments is a bit better as a universal long term name
Even "commitment" operation can be reverted, so the issue with naming is true even today
Signed-off-by: Danil <[email protected]>
} | ||
|
||
s.precommitmentForTheLatestBatch = currentPrecommitment; |
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.
could we name it rollingTxsHash
in this way we keep the meaning, but detach it from precommit operation
@@ -76,6 +76,8 @@ contract DiamondInit is ZKChainBase, IDiamondInit { | |||
s.priorityTxMaxGasLimit = _initializeData.priorityTxMaxGasLimit; | |||
s.feeParams = _initializeData.feeParams; | |||
s.priorityTree.setup(s.priorityQueue.getTotalPriorityTxs()); | |||
// FIXME: include it in the upgrade. |
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.
will be fixed after merging back draft-v29
What ❔
Why ❔
Checklist