Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Set of fixes for boojum integration #53

Merged
merged 34 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
934d8cd
apply max system contracts address
StanislavBreadless Oct 30, 2023
03ae0fe
add comment
StanislavBreadless Oct 30, 2023
1ded147
Allow only deployments for L1->L2
StanislavBreadless Oct 30, 2023
dc0aa8f
fail to publish timesstamp
StanislavBreadless Oct 30, 2023
ff69c5c
remove trailing comma
StanislavBreadless Oct 30, 2023
4939acc
correct require for L1Messenger
StanislavBreadless Oct 30, 2023
ff73f7c
fix eip1559
StanislavBreadless Oct 30, 2023
015fa52
charge correctly for the memory overhead
StanislavBreadless Oct 30, 2023
e05bb21
check that we have enough gas for postop
StanislavBreadless Oct 30, 2023
abd65b9
fix comment in L1Messenger
StanislavBreadless Oct 30, 2023
53b6d58
remove redundant check
StanislavBreadless Oct 30, 2023
479ab08
safeAdd for refunds
StanislavBreadless Oct 30, 2023
1f89a6b
compilation fixes + EOA work correctly on delegatecall
StanislavBreadless Oct 30, 2023
2d479d4
correctly charge for gas overhead
StanislavBreadless Oct 30, 2023
5487915
ensure that upgrade tx always succeeds
StanislavBreadless Oct 30, 2023
963c5e0
add force deploy for keccak256
StanislavBreadless Oct 30, 2023
1449d37
max precompile address fix
StanislavBreadless Oct 30, 2023
d2103a5
correct refund gas for L1 gas
StanislavBreadless Oct 30, 2023
700f380
fix shifting
StanislavBreadless Oct 30, 2023
70f6ee4
correct meta calculation
StanislavBreadless Oct 30, 2023
28718b1
nits
StanislavBreadless Oct 30, 2023
b48fc2b
prev hash
StanislavBreadless Oct 30, 2023
e5400cf
fix some nits
StanislavBreadless Oct 30, 2023
2027a2c
remove unneeded casting
StanislavBreadless Oct 30, 2023
df46be0
fix lint
StanislavBreadless Oct 31, 2023
9e3f850
update hashes
StanislavBreadless Oct 31, 2023
9d2f40c
update hashes
StanislavBreadless Oct 31, 2023
59b26b3
Update bootloader/bootloader.yul
StanislavBreadless Oct 31, 2023
50957fd
update max precompile address constant
StanislavBreadless Oct 31, 2023
4ccbbb2
Merge remote-tracking branch 'origin/sb-boojum-integration-patch' int…
StanislavBreadless Oct 31, 2023
9ab3e8c
Only the deployer can increment the deployment nonce
StanislavBreadless Oct 31, 2023
7108391
fix lint
StanislavBreadless Oct 31, 2023
b2fc4c4
add some tests
StanislavBreadless Oct 31, 2023
ff94873
sync with base
StanislavBreadless Nov 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SystemConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"L1_TX_INTRINSIC_L2_GAS": 167157,
"L1_TX_INTRINSIC_PUBDATA": 88,
"MAX_GAS_PER_TRANSACTION": 80000000,
"BOOTLOADER_MEMORY_FOR_TXS": 273132,
"BOOTLOADER_MEMORY_FOR_TXS": 8740224,
"REFUND_GAS": 7343,
"KECCAK_ROUND_COST_GAS": 40,
"SHA256_ROUND_COST_GAS": 7,
Expand Down
64 changes: 32 additions & 32 deletions SystemContractsHashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@
"contractName": "AccountCodeStorage",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/AccountCodeStorage.sol/AccountCodeStorage.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/AccountCodeStorage.sol",
"bytecodeHash": "0x0100009b3cd9a137912ffbd406a1d73eaffbcf40a760f3956fea7e051f0c6101",
"bytecodeHash": "0x0100009b57d7cdcc4f8ca7150714056a3ba2015170016b31345c8e9be7b1bd07",
"sourceCodeHash": "0xf56f18d6ccec4a1e083ece9d5dea511b610905b3be42bf81e81e53f8a7028162"
},
{
"contractName": "BootloaderUtilities",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/BootloaderUtilities.sol/BootloaderUtilities.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/BootloaderUtilities.sol",
"bytecodeHash": "0x01000975e811c2ba4a3b28f70426598129f0029feb086714980f9513f59531c7",
"bytecodeHash": "0x0100097545ca2b44abb9a998284944aa7f480a5395dc22f0938f263512165572",
"sourceCodeHash": "0xcb8d18786a9dca90524de992e3216f57d89192600c2aa758f071a6a6ae3162c4"
},
{
"contractName": "ComplexUpgrader",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/ComplexUpgrader.sol/ComplexUpgrader.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/ComplexUpgrader.sol",
"bytecodeHash": "0x0100005b2eef785c804dc40ec24b3c2339b11a314fec6eb91db551a2523d6a2b",
"bytecodeHash": "0x0100005bdf8df3533c093ed25a5dc0c9fe0b96c444b9e7a736c45b3ea2a1960d",
"sourceCodeHash": "0x02b3234b8aa3dde88cf2cf6c1447512dd953ed355be9ba21c22d48ca6d3eee67"
},
{
"contractName": "Compressor",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/Compressor.sol/Compressor.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/Compressor.sol",
"bytecodeHash": "0x010001b7a7bb988e52b8fca05d82bccf63ea34c6617ebea1765c91e911386756",
"bytecodeHash": "0x010001b777c7dd2dc5783c886ba26ba116e52c12b429508bed85937f8c7fa796",
"sourceCodeHash": "0x214a2b123ecdf3b135709d0b6207b3d41d9e8c68a0aa74b88c64fc983382d7b0"
},
{
"contractName": "ContractDeployer",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/ContractDeployer.sol/ContractDeployer.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/ContractDeployer.sol",
"bytecodeHash": "0x010005bb3e1bb343565920b37c6c0d716dcfca45bbdada20a305e80ab60a6916",
"sourceCodeHash": "0xed9088758b3cbc9c450da0ac18e0e11359efe7341219ac1c331a4f5712c2dacb"
"bytecodeHash": "0x010006098193e41685f5e63b2d0e7369be71b39f41ccd13296a03801645fb1df",
"sourceCodeHash": "0x86a2b81dabf56644a7d183c7a8ceb58ce5a2417f89af9eed2491c44943b7cd0a"
},
{
"contractName": "DefaultAccount",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/DefaultAccount.sol/DefaultAccount.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/DefaultAccount.sol",
"bytecodeHash": "0x0100065d0ea6130f484f6cd4936f2d5114abc9961328d6acd8b311dd00b94546",
"sourceCodeHash": "0x34aaf3d8fbe90cf35efcfa5d8361de8a97be0a7cb60b9b117cda0dfd78fab6a6"
"bytecodeHash": "0x01000651d5f10f05669c19eb992636468629e13c627c57e62dfbaa9d9b313e54",
"sourceCodeHash": "0x9e2ce7d1980532ec388a1079ef68d1eb4e7cec2cf8b0f750f5c62d558f90eb6e"
},
{
"contractName": "EmptyContract",
Expand All @@ -52,50 +52,50 @@
"contractName": "ImmutableSimulator",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/ImmutableSimulator.sol/ImmutableSimulator.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/ImmutableSimulator.sol",
"bytecodeHash": "0x01000047b7e40b0e0f7bd7051e20853a49b972c6c0ac16872425067cb3288f08",
"bytecodeHash": "0x01000047491565697b9e25232a0f8a4cd870d1f7ada0756e87870be1bcc16de7",
"sourceCodeHash": "0x315e71df564977165decbbbda504fee9d3dd98b6ca1e5dc68572d74bc308b03f"
},
{
"contractName": "KnownCodesStorage",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/KnownCodesStorage.sol/KnownCodesStorage.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/KnownCodesStorage.sol",
"bytecodeHash": "0x0100008b806f904a40cadb94318db1d8a8ae9a579f46ee0b50432e4c221572ee",
"bytecodeHash": "0x0100008bbd2766597fd11f3d30a2a44c204f6fd0c418893bb8baa532d151e63f",
"sourceCodeHash": "0x33c7e9af04650d7e802ecfcf099fefde1ddb1a4268f521c0d69dea014ce5853d"
},
{
"contractName": "L1Messenger",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/L1Messenger.sol/L1Messenger.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/L1Messenger.sol",
"bytecodeHash": "0x010002fb863dc09dbfdae276418c307eb39af03f335a0b23a2edc8bcd1835fce",
"sourceCodeHash": "0x1c355d04ecf4e4c39ab6481f2bb17e5e30d3aa4563342aaa4c9aa122ac3a14d3"
"bytecodeHash": "0x010003010b1831cbe1c9eff5407f46cdafef9ead24e5b10571ea681cd04b044a",
"sourceCodeHash": "0xc6d60bfcea55041604cf3714bf4d9e0af51737953e1578430f574f800e4292d7"
},
{
"contractName": "L2EthToken",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/L2EthToken.sol/L2EthToken.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/L2EthToken.sol",
"bytecodeHash": "0x01000139b0930df0818b0f10f7c78feed9ca93020efcb72e749a7ea842d08576",
"bytecodeHash": "0x01000139431883ef14d8e0ac63fe7812cc691d9439f822156804df13608f252f",
"sourceCodeHash": "0xb8e404a5e82c50b9f0cfb6412049d1174df3fbe8af40750a756ad0c1cfefb593"
},
{
"contractName": "MsgValueSimulator",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/MsgValueSimulator.sol/MsgValueSimulator.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/MsgValueSimulator.sol",
"bytecodeHash": "0x0100006f5dab2685a586d5ebbd360a2c1c2d593df1ab8267d8e172d92a202bfa",
"bytecodeHash": "0x0100006f3f47fe89b9d7ffc1abc4f1d203aa6000cbc6887398f41a470164d6c1",
"sourceCodeHash": "0x038cc8e7fe97ad4befa2d5ab4ae77fdefdecc20338142565b8086cd9342868ef"
},
{
"contractName": "NonceHolder",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/NonceHolder.sol/NonceHolder.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/NonceHolder.sol",
"bytecodeHash": "0x0100012f7252eee16af884775bd3279b577bbed64f124349ac6179aeb6ae3cb8",
"sourceCodeHash": "0xdfdd234e9d7f6cc7dfb0b9c8b6a2dea3dc40204539bfb836c9ae2bb1dc9cbb1f"
"bytecodeHash": "0x0100012d09bdadbfaf7cb3b4b9ef06e834854348fa85562d5671f64eae501f51",
"sourceCodeHash": "0x6f6fbe275497e3423b9b3b954b96ee7f7db5f5cd98a2ef1f4d6b4f83cb484234"
},
{
"contractName": "SystemContext",
"bytecodePath": "artifacts-zk/cache-zk/solpp-generated-contracts/SystemContext.sol/SystemContext.json",
"sourceCodePath": "cache-zk/solpp-generated-contracts/SystemContext.sol",
"bytecodeHash": "0x0100023f1761d12df53e8581fabcb359cb069bbd2a7a7a3ef0b49f2f5d46169a",
"sourceCodeHash": "0x60d9007efb7f1bf9417f0856f3799937357a64c2e5f858d13d3ee584e8b9832e"
"bytecodeHash": "0x0100023b228f6ad41173bffaf14a9b58f22d3cd1e7d3de6c081a9d16d2f1bd27",
"sourceCodeHash": "0xf5552ba7b356e3fdcc55af6510fbdba9cec77f66a8ec9930a657d5aea5add4fb"
},
{
"contractName": "EventWriter",
Expand All @@ -108,15 +108,15 @@
"contractName": "EcAdd",
"bytecodePath": "contracts/precompiles/artifacts/EcAdd.yul/EcAdd.yul.zbin",
"sourceCodePath": "contracts/precompiles/EcAdd.yul",
"bytecodeHash": "0x010000c56c054a0de4a36b133d3c114ec514c3ce0334ad7759c202392386a913",
"sourceCodeHash": "0xe73c8960a8b4060113adca9f03207d379580d172df9f0b499dd5353934a557a6"
"bytecodeHash": "0x010000c5a85a372f441ac693210a18e683b530bed875fdcab2f7e101b057d433",
"sourceCodeHash": "0x32645126b8765e4f7ced63c9508c70edc4ab734843d5f0f0f01d153c27206cee"
},
{
"contractName": "EcMul",
"bytecodePath": "contracts/precompiles/artifacts/EcMul.yul/EcMul.yul.zbin",
"sourceCodePath": "contracts/precompiles/EcMul.yul",
"bytecodeHash": "0x010001378d31273c8e58caa12bcf1a5694e66a0aefdba2504adb8e3eb02b21c7",
"sourceCodeHash": "0x6c4b11542bcf85e6e02ca193fc0548353b1f21c27e972b9e73781e8f7eaf50b0"
"bytecodeHash": "0x0100013759b40792c2c3d033990e992e5508263c15252eb2d9bfbba571350675",
"sourceCodeHash": "0xdad8be6e926155a362ea05b132ba8b6c634e978a41f79bb6390b870e18049e45"
},
{
"contractName": "Ecrecover",
Expand All @@ -143,35 +143,35 @@
"contractName": "bootloader_test",
"bytecodePath": "bootloader/build/artifacts/bootloader_test.yul/bootloader_test.yul.zbin",
"sourceCodePath": "bootloader/build/bootloader_test.yul",
"bytecodeHash": "0x0100037b0462ed355364eaabccbea2a018afad4c8841b9856514c027400f1b10",
"sourceCodeHash": "0x467a36057882d6740a016cda812798d1be9a0ea60cb7ef90996e2c5be55e75a4"
"bytecodeHash": "0x010003852143f6658ecc92ebd784759a34b444f01bc78643e1bd4b0c479157e1",
"sourceCodeHash": "0x141bbebe33792f75d7727e5a19a928e38f14b4da7ccf21e582b9a6a8ba4017bb"
},
{
"contractName": "fee_estimate",
"bytecodePath": "bootloader/build/artifacts/fee_estimate.yul/fee_estimate.yul.zbin",
"sourceCodePath": "bootloader/build/fee_estimate.yul",
"bytecodeHash": "0x010009434283c0bc9f32e51a9aa84523ee7a381e3e0c5ae63f639998d915f54b",
"sourceCodeHash": "0x3fb415ac6f59c35ea17b85aabb551df1b44a6fc7e051c2e33f5fc76c17432167"
"bytecodeHash": "0x0100096b643f53e2d82883d76899b9d2fa36d73eb4462b7f4cc8623c238f4b5e",
"sourceCodeHash": "0x576a59bca03442bea891eadff82ef6515844fe9cea143928c2101999c9353a67"
},
{
"contractName": "gas_test",
"bytecodePath": "bootloader/build/artifacts/gas_test.yul/gas_test.yul.zbin",
"sourceCodePath": "bootloader/build/gas_test.yul",
"bytecodeHash": "0x01000927ea81a1afe5a586853a9c43fb928bcf1f1fba51a19c48ce1b940867c7",
"sourceCodeHash": "0x84648c958714d952248b8553456b5a5e3860e00871f01644297531e991a67d64"
"bytecodeHash": "0x0100094be8b6434783b9132dc59c8a55810e30c689caf4b97f011ba5484a8071",
"sourceCodeHash": "0xfb030709056ad8876e46d24d740db4616d023da662c447596d9fbfd7b2f37ec0"
},
{
"contractName": "playground_batch",
"bytecodePath": "bootloader/build/artifacts/playground_batch.yul/playground_batch.yul.zbin",
"sourceCodePath": "bootloader/build/playground_batch.yul",
"bytecodeHash": "0x0100094d801bf4180d020692a95cf26a3c9adcaedfd5be47ec08b1637b0282da",
"sourceCodeHash": "0xe02bed16015da2f03dcf5a7ed1bf2132009e69f4bfb5335e13cc406327e84d5e"
"bytecodeHash": "0x010009753bfed17c34977063d4c3c54a6305db6be5416908183e5732cc447c18",
"sourceCodeHash": "0x28328cbd84864be273fd975d3e2419b3e81216d94a1468f55f7a8673b98a45f9"
},
{
"contractName": "proved_batch",
"bytecodePath": "bootloader/build/artifacts/proved_batch.yul/proved_batch.yul.zbin",
"sourceCodePath": "bootloader/build/proved_batch.yul",
"bytecodeHash": "0x010009411d9c2342671c57d5ce038ce3e142c750df85ac5d23f67b4e4215fede",
"sourceCodeHash": "0xd48e5abbfbb493eacfcbe6dc788eada867d58ab8596d55736b496b1c2e22c636"
"bytecodeHash": "0x0100096558918a9a6b1bc9b1e7fad3c8eac481379e7b2a45b72328543c7c6c29",
"sourceCodeHash": "0x18ea644d20160058fd21424c212c7adf37c98be61996bddf39ba47f9506ad21a"
}
]
62 changes: 48 additions & 14 deletions bootloader/bootloader.yul
Original file line number Diff line number Diff line change
Expand Up @@ -917,11 +917,9 @@ object "Bootloader" {

// In case the operator provided smaller refund than the one calculated
// by the bootloader, we return the refund calculated by the bootloader.
refundGas := max(getOperatorRefundForTx(transactionIndex), potentialRefund)
refundGas := max(getOperatorRefundForTx(transactionIndex), safeAdd(potentialRefund, reservedGas, "iop"))
}

refundGas := add(refundGas, reservedGas)

if gt(refundGas, gasLimit) {
assertionError("L1: refundGas > gasLimit")
}
Expand All @@ -939,10 +937,14 @@ object "Bootloader" {
let toRefundRecipient
switch success
case 0 {
if iszero(isPriorityOp) {
// Upgrade transactions must always succeed
assertionError("Upgrade tx failed")
}

// If the transaction reverts, then minting the msg.value to the user has been reverted
// as well, so we can simply mint everything that the user has deposited to
// the refund recipient

toRefundRecipient := safeSub(getReserved0(innerTxDataOffset), payToOperator, "vji")
}
default {
Expand Down Expand Up @@ -1178,7 +1180,7 @@ object "Bootloader" {
/// @param txDataOffset The offset to the ABI-encoded Transaction struct.
/// @param gasLimitForTx The L2 gas limit for the transaction validation & execution.
/// @param gasPrice The L2 gas price that should be used by the transaction.
/// @return ergsLeft The ergs left after the validation step.
/// @return gasLeft The gas left after the validation step.
function l2TxValidation(
txDataOffset,
gasLimitForTx,
Expand Down Expand Up @@ -1230,9 +1232,9 @@ object "Bootloader" {

/// @dev The function responsible for the execution step of the L2 transaction.
/// @param txDataOffset The offset to the ABI-encoded Transaction struct.
/// @param ergsLeft The ergs left after the validation step.
/// @param gasLeft The gas left after the validation step.
/// @return success Whether or not the execution step was successful.
/// @return ergsSpentOnExecute The ergs spent on the transaction execution.
/// @return gasSpentOnExecute The gas spent on the transaction execution.
function l2TxExecution(
txDataOffset,
gasLeft,
Expand Down Expand Up @@ -1262,7 +1264,7 @@ object "Bootloader" {
default {
// Note, that since gt(gasLeft, gasSpentOnFactoryDeps) = true
// sub(gasLeft, gasSpentOnFactoryDeps) > 0, which is important
// because a nearCall with 0 ergs passes on all the ergs of the parent frame.
// because a nearCall with 0 gas passes on all the gas of the parent frame.
gasLeft := sub(gasLeft, gasSpentOnFactoryDeps)

let executeABI := getNearCallABI(gasLeft)
Expand Down Expand Up @@ -1425,6 +1427,7 @@ object "Bootloader" {
refundRecipient := paymaster

if gt(gasLeft, 0) {
checkEnoughGas(gasLeft)
let nearCallAbi := getNearCallABI(gasLeft)
let gasBeforePostOp := gas()
pop(ZKSYNC_NEAR_CALL_callPostOp(
Expand All @@ -1435,7 +1438,7 @@ object "Bootloader" {
success,
// Since the paymaster will be refunded with reservedGas,
// it should know about it
safeAdd(gasLeft, reservedGas, "jkl"),
safeAdd(gasLeft, reservedGas, "jkl")
))
let gasSpentByPostOp := sub(gasBeforePostOp, gas())

Expand Down Expand Up @@ -1595,7 +1598,7 @@ object "Bootloader" {
/// @dev Get checked for overcharged operator's overhead for the transaction.
/// @param transactionIndex The index of the transaction in the batch
/// @param txTotalGasLimit The total gass limit of the transaction (including the overhead).
/// @param gasPerPubdataByte The price for pubdata byte in ergs.
/// @param gasPerPubdataByte The price for pubdata byte in gas.
/// @param txEncodeLen The length of the ABI-encoding of the transaction
function getVerifiedOperatorOverheadForTx(
transactionIndex,
Expand Down Expand Up @@ -1755,6 +1758,37 @@ object "Bootloader" {
}
<!-- @endif -->

/// @dev Given the callee and the data to be called with,
/// this function returns whether the mimicCall should use the `isSystem` flag.
/// This flag should only be used for contract deployments and nothing else.
/// @param to The callee of the call.
/// @param dataPtr The pointer to the calldata of the transaction.
function shouldMsgValueMimicCallBeSystem(to, dataPtr) -> ret {
let dataLen := mload(dataPtr)
// Note, that this point it is not fully known whether it is indeed the selector
// of the calldata (it might not be the case if the `dataLen` < 4), but it will be checked later on
let selector := shr(224, mload(add(dataPtr, 32)))

let isSelectorCreate := or(
eq(selector, {{CREATE_SELECTOR}}),
eq(selector, {{CREATE_ACCOUNT_SELECTOR}})
)
let isSelectorCreate2 := or(
eq(selector, {{CREATE2_SELECTOR}}),
eq(selector, {{CREATE2_ACCOUNT_SELECTOR}})
)

// Firstly, ensure that the selector is a valid deployment function
ret := or(
isSelectorCreate,
isSelectorCreate2
)
// Secondly, ensure that the callee is ContractDeployer
ret := and(ret, eq(to, CONTRACT_DEPLOYER_ADDR()))
// Thirdly, ensure that the calldata is long enough to contain the selector
ret := and(ret, gt(dataLen, 3))
}

/// @dev Given the pointer to the calldata, the value and to
/// performs the call through the msg.value simulator.
/// @param to Which contract to call
Expand All @@ -1764,7 +1798,7 @@ object "Bootloader" {
/// the length of the calldata and the calldata itself right afterwards.
function msgValueSimulatorMimicCall(to, from, value, dataPtr) -> success {
// Only calls to the deployer system contract are allowed to be system
let isSystem := eq(to, CONTRACT_DEPLOYER_ADDR())
let isSystem := shouldMsgValueMimicCallBeSystem(to, dataPtr)

success := mimicCallOnlyResult(
MSG_VALUE_SIMULATOR_ADDR(),
Expand Down Expand Up @@ -2515,7 +2549,7 @@ object "Bootloader" {
)

if iszero(success) {
debugLog("Failed publish timestamp data to L1", 0)
debugLog("Failed publish timestamp to L1", 0)
revertWithReason(FAILED_TO_PUBLISH_TIMESTAMP_DATA_TO_L1(), 1)
}
}
Expand Down Expand Up @@ -2902,7 +2936,7 @@ object "Bootloader" {

<!-- @endif -->

<!-- @if BOOTLOADER_TYPE=='proved_block' -->
<!-- @if BOOTLOADER_TYPE=='proved_batch' -->
assertEq(gt(getFrom(innerTxDataOffset), MAX_SYSTEM_CONTRACT_ADDR()), 1, "from in kernel space")
<!-- @endif -->

Expand Down Expand Up @@ -3255,7 +3289,7 @@ object "Bootloader" {
}
}

/// @dev Returns the addition of two unsigned integers, reverting on overflow.
/// @dev Returns the subtraction of two unsigned integers, reverting on underflow.
function safeSub(x, y, errMsg) -> ret {
if gt(y, x) {
assertionError(errMsg)
Expand Down
Loading