-
Notifications
You must be signed in to change notification settings - Fork 340
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: Sync layer stable #672
base: dev
Are you sure you want to change the base?
Conversation
bytes32 _l2DAValidatorOutputHash, | ||
bytes calldata _operatorDAInput, | ||
uint256 _maxBlobsSupported | ||
) external returns (L1DAValidatorOutput memory output); |
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.
Are you sure you want to make it non-static? This opens many questions on the call trace control (like reentrancy) but I don't think a stateful DA contract is popular
) external returns (L1DAValidatorOutput memory output); | |
) external view returns (L1DAValidatorOutput memory output); |
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.
@vladbochok The reason it is non-static is because on gateway we relay the calldata to L1 in this method.
pragma solidity 0.8.24; | ||
|
||
struct L1DAValidatorOutput { | ||
/// @dev The hash of the uncompressed state diff. |
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.
Please use standard natspec
with param
notation similar to this:
bytes32[] blobsOpeningCommitments; | ||
} | ||
|
||
interface IL1DAValidator { |
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.
Why are these contracts stored in a separate directory? Wouldn't it be better to store it in l1-contracts
dir?
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.
Because of compilation reasons. They use the blobHash opcode, which is not supported for hardhat zk compilation. This was the easiest solution that we saw
|
||
pragma solidity 0.8.24; | ||
|
||
struct L1DAValidatorOutput { |
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.
The convention we use for people who find a bug in the contract can find our contact quickly.
struct L1DAValidatorOutput { | |
/// @author Matter Labs | |
/// @custom:security-contact [email protected] | |
struct L1DAValidatorOutput { |
l1-contracts/contracts/state-transition/chain-deps/facets/Admin.sol
Outdated
Show resolved
Hide resolved
|
||
/// @notice Contract that contains the functionality for process the calldata DA. | ||
/// @dev The expected l2DAValidator that should be used with it `RollupL2DAValidator`. | ||
abstract contract CalldataDA { |
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.
Why does this abstract contract exist? Wouldn't be better to just have it internal functions in the RollupL1DAValidator
?
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.
This is functionality reused in RollupL1DAValidator
and CalldataDAGateway
. In the perfect world we would've put those into the same folder but we can not for compilation reasons
@@ -180,15 +181,19 @@ contract ValidatorTimelock is IExecutor, Ownable2Step { | |||
|
|||
/// @dev Check that batches were committed at least X time ago and | |||
/// make a call to the hyperchain diamond contract with the same calldata. | |||
function executeBatches(StoredBatchInfo[] calldata _newBatchesData) external onlyValidator(ERA_CHAIN_ID) { | |||
_executeBatchesInner(ERA_CHAIN_ID, _newBatchesData); | |||
function executeBatches( |
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.
ValidatorTimelock should be backward compatible with all chain version from now and later, so I propose adding function executeBatches(StoredBatchInfo[] calldata _newBatchesData)
so chains that haven't update yet would work as expected.
Better to make the one interface to not redeploy contract in the future at all, but let discuss it
…contracts into kl/message-root-update
…contracts into kl/sync-layer-reorg
Signed-off-by: Danil <[email protected]> Co-authored-by: Neo <[email protected]> Co-authored-by: tommysr <[email protected]> Co-authored-by: Rahul Saxena <[email protected]> Co-authored-by: Artem Makhortov <[email protected]> Co-authored-by: Bence Haromi <[email protected]> Co-authored-by: Zach Kolodny <[email protected]> Co-authored-by: Stanislav Bezkorovainyi <[email protected]> Co-authored-by: Vlad Bochok <[email protected]> Co-authored-by: perekopskiy <[email protected]> Co-authored-by: perekopskiy <[email protected]> Co-authored-by: Danil <[email protected]> Co-authored-by: Ivan Schasny <[email protected]> Co-authored-by: Raid5594 <[email protected]> Co-authored-by: Raid Ateir <[email protected]>
Signed-off-by: Danil <[email protected]> Co-authored-by: Neo <[email protected]> Co-authored-by: tommysr <[email protected]> Co-authored-by: Rahul Saxena <[email protected]> Co-authored-by: Artem Makhortov <[email protected]> Co-authored-by: Bence Haromi <[email protected]> Co-authored-by: Zach Kolodny <[email protected]> Co-authored-by: Stanislav Bezkorovainyi <[email protected]> Co-authored-by: Vlad Bochok <[email protected]> Co-authored-by: perekopskiy <[email protected]> Co-authored-by: perekopskiy <[email protected]> Co-authored-by: Danil <[email protected]> Co-authored-by: Ivan Schasny <[email protected]> Co-authored-by: Raid5594 <[email protected]> Co-authored-by: Raid Ateir <[email protected]>
/// @dev The contract responsible for handling tokens native to a single chain. | ||
IL2NativeTokenVault constant L2_NATIVE_TOKEN_VAULT = IL2NativeTokenVault(address(USER_CONTRACTS_OFFSET + 0x04)); | ||
|
||
uint256 constant L1_CHAIN_ID = 1; |
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.
lets not forget to remove
…a-contracts into kl/l2-native-token
…led deposits for bridged tokens, add forwarding function to L1AR for SDK
…-contracts into ra/l2-native
Merge reorg stable
fix: Ra/l2 native
fix: l2-native-token, bridge fixes
feat: periodic merge with multiple fixes
What ❔
Why ❔
Checklist