From 3e351f6c27293eda6f89fdab1a4cd2cb3a2b680a Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Mon, 10 Jun 2024 14:42:22 +0200 Subject: [PATCH 1/5] added comments about fields that should have fixed layout --- system-contracts/contracts/SystemContext.sol | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system-contracts/contracts/SystemContext.sol b/system-contracts/contracts/SystemContext.sol index a37cf0c19..99a8cf2e0 100644 --- a/system-contracts/contracts/SystemContext.sol +++ b/system-contracts/contracts/SystemContext.sol @@ -56,12 +56,21 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr /// @notice The hashes of batches. /// @dev It stores batch hashes for all previous batches. + /// The layout of this field is + /// {"offset":0,"slot":"8","type":"t_mapping(t_uint256,t_bytes32)"} + /// and it must not be changes, because batch verification in zksync-era depends on it. mapping(uint256 batchNumber => bytes32 batchHash) internal batchHashes; /// @notice The number and the timestamp of the current L2 block. + /// The layout of this field is + /// {"offset":0,"slot":"9","type":"t_struct(BlockInfo)1434_storage"} + /// and it must not be changes, because batch verification in zksync-era depends on it. BlockInfo internal currentL2BlockInfo; /// @notice The rolling hash of the transactions in the current L2 block. + /// The layout of this field is + /// {"offset":0,"slot":"10","type":"t_bytes32"} + /// and it must not be changes, because batch verification in zksync-era depends on it. bytes32 internal currentL2BlockTxsRollingHash; /// @notice The hashes of L2 blocks. From e46180a23e2bc26157f409a343e748034621e302 Mon Sep 17 00:00:00 2001 From: pompon0 Date: Thu, 13 Jun 2024 08:49:15 +0200 Subject: [PATCH 2/5] Update system-contracts/contracts/SystemContext.sol Co-authored-by: Stanislav Bezkorovainyi --- system-contracts/contracts/SystemContext.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-contracts/contracts/SystemContext.sol b/system-contracts/contracts/SystemContext.sol index 99a8cf2e0..a20ec71d1 100644 --- a/system-contracts/contracts/SystemContext.sol +++ b/system-contracts/contracts/SystemContext.sol @@ -64,7 +64,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr /// @notice The number and the timestamp of the current L2 block. /// The layout of this field is /// {"offset":0,"slot":"9","type":"t_struct(BlockInfo)1434_storage"} - /// and it must not be changes, because batch verification in zksync-era depends on it. + /// and it must not be changed, because batch verification in zksync-era depends on it. BlockInfo internal currentL2BlockInfo; /// @notice The rolling hash of the transactions in the current L2 block. From 37ff1d67e1780b162a61503150a75cb7b30bf2e6 Mon Sep 17 00:00:00 2001 From: pompon0 Date: Thu, 13 Jun 2024 08:49:20 +0200 Subject: [PATCH 3/5] Update system-contracts/contracts/SystemContext.sol Co-authored-by: Stanislav Bezkorovainyi --- system-contracts/contracts/SystemContext.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-contracts/contracts/SystemContext.sol b/system-contracts/contracts/SystemContext.sol index a20ec71d1..3ace3a109 100644 --- a/system-contracts/contracts/SystemContext.sol +++ b/system-contracts/contracts/SystemContext.sol @@ -58,7 +58,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr /// @dev It stores batch hashes for all previous batches. /// The layout of this field is /// {"offset":0,"slot":"8","type":"t_mapping(t_uint256,t_bytes32)"} - /// and it must not be changes, because batch verification in zksync-era depends on it. + /// and it must not be changed, because batch verification in zksync-era depends on it. mapping(uint256 batchNumber => bytes32 batchHash) internal batchHashes; /// @notice The number and the timestamp of the current L2 block. From 2289b1bc22a2d3bd788ecc5a7ac455ee00a5f0ba Mon Sep 17 00:00:00 2001 From: pompon0 Date: Thu, 13 Jun 2024 08:49:26 +0200 Subject: [PATCH 4/5] Update system-contracts/contracts/SystemContext.sol Co-authored-by: Stanislav Bezkorovainyi --- system-contracts/contracts/SystemContext.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-contracts/contracts/SystemContext.sol b/system-contracts/contracts/SystemContext.sol index 3ace3a109..8c1197639 100644 --- a/system-contracts/contracts/SystemContext.sol +++ b/system-contracts/contracts/SystemContext.sol @@ -70,7 +70,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr /// @notice The rolling hash of the transactions in the current L2 block. /// The layout of this field is /// {"offset":0,"slot":"10","type":"t_bytes32"} - /// and it must not be changes, because batch verification in zksync-era depends on it. + /// and it must not be changed, because batch verification in zksync-era depends on it. bytes32 internal currentL2BlockTxsRollingHash; /// @notice The hashes of L2 blocks. From 7dca557ec1c1dc7c4171c2b75d0ddf4991e2e585 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 13 Jun 2024 08:55:15 +0200 Subject: [PATCH 5/5] fixed hashes --- system-contracts/SystemContractsHashes.json | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/system-contracts/SystemContractsHashes.json b/system-contracts/SystemContractsHashes.json index 5c927c10f..58308b2d1 100644 --- a/system-contracts/SystemContractsHashes.json +++ b/system-contracts/SystemContractsHashes.json @@ -108,8 +108,8 @@ "contractName": "SystemContext", "bytecodePath": "artifacts-zk/contracts-preprocessed/SystemContext.sol/SystemContext.json", "sourceCodePath": "contracts-preprocessed/SystemContext.sol", - "bytecodeHash": "0x010001a55d8778874657090f2db3a8aeabd491a5f3352f04c89eadabdd92e6ba", - "sourceCodeHash": "0xf23d12ad2f17ad3b26e909fabfdcfaf4e1d158923e7cb8eeb9b5965a0b464406" + "bytecodeHash": "0x010001a5e9cf376f6695226a628c9972e5b60f0c9124ae83532d8c857d60e1f2", + "sourceCodeHash": "0x5f8c86bbdcbd08ce2f484c971cfe664320facb2e37cceec5c35a885ceb0dfbde" }, { "contractName": "EventWriter", @@ -178,35 +178,35 @@ "contractName": "bootloader_test", "bytecodePath": "bootloader/build/artifacts/bootloader_test.yul.zbin", "sourceCodePath": "bootloader/build/bootloader_test.yul", - "bytecodeHash": "0x010003cb92f46b717a3351f085b9d0d7cf1b6c164f390487f29da5c3b1f272a1", - "sourceCodeHash": "0xbf798f55f3b5c3d4d29423278bd68c6bb6428f0290f6791b2e20963166b3b21a" + "bytecodeHash": "0x010003cbcf3b08c05205b2a099499df8bb7a52700670076064213af8f24bb049", + "sourceCodeHash": "0x8d8732ff7c96e6d79afe76a28dcb5278133e6ba6269d4204537349042533d82e" }, { "contractName": "fee_estimate", "bytecodePath": "bootloader/build/artifacts/fee_estimate.yul.zbin", "sourceCodePath": "bootloader/build/fee_estimate.yul", - "bytecodeHash": "0x01000951d5e14249434340fe5e6be707157f16d66ca10d0e5fcc110cc674def4", - "sourceCodeHash": "0xc7cd680273e89b1dfc3c6941f69611894c885e26656adfc4586c4eb149285d9d" + "bytecodeHash": "0x0100095185b18955a2f7797a860965173939afa05b7f83754a609a93a2224af1", + "sourceCodeHash": "0xa78a2db4f98e59c548a38d5fd2f1c547be9afb8c0652ffc1663134039ed96b56" }, { "contractName": "gas_test", "bytecodePath": "bootloader/build/artifacts/gas_test.yul.zbin", "sourceCodePath": "bootloader/build/gas_test.yul", - "bytecodeHash": "0x010008d7db21670fda613a703321bb109f192ef92a6cef40b07a35a661c4d563", - "sourceCodeHash": "0xaf85e223e2156440f007fed14c9fe8899d33ad2f0aeb7feab3f4fd81d759bfb6" + "bytecodeHash": "0x010008d77a8137a3de1fa599b2fbdf1a0988d061ad68e6db178ec482c2c2af7b", + "sourceCodeHash": "0x3b5121cbcafaef72fb037e58f4e60839c83549dde388c3f25281aa996b4fd728" }, { "contractName": "playground_batch", "bytecodePath": "bootloader/build/artifacts/playground_batch.yul.zbin", "sourceCodePath": "bootloader/build/playground_batch.yul", - "bytecodeHash": "0x0100095722e18e6831abbece78d3bbaac4fe187db091d6be75d0c6f59aff0f7f", - "sourceCodeHash": "0xac0a99374868ffafa2427f23a7fd1f5f8551402904efbdf84f38638cad00ec14" + "bytecodeHash": "0x010009572411abe29a7372ddeefcbfa188994c5269a4f0a1d6ced4ddab0adebf", + "sourceCodeHash": "0xa38cea1d3c109106bd06260493d2d7d93f085d32ba1e4e21ed5ed0cd2cdcfb3d" }, { "contractName": "proved_batch", "bytecodePath": "bootloader/build/artifacts/proved_batch.yul.zbin", "sourceCodePath": "bootloader/build/proved_batch.yul", - "bytecodeHash": "0x010008e75c912d19d915dc90467be59c81c8004271b03639354806f669f14ad3", - "sourceCodeHash": "0x25e4cdb4020792f534611de304297e7e0230ed7ea0510bc049862c2540cc458e" + "bytecodeHash": "0x010008e7c428e5bc083b1bb2f0e7ed869fec362467ea1af0524e4e8a7b1584ad", + "sourceCodeHash": "0xb57063cabbf38184042eb79fa2f350e4646cc44af69131ab443be90e9a717680" } ]