Skip to content
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: Add side effect counter to logs #5718

Merged
merged 52 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
37833e0
Refactor public inputs in noir.
LeilaWang Mar 21, 2024
3887c9f
WIP.
LeilaWang Mar 24, 2024
c9dcb2d
Update ts.
LeilaWang Mar 28, 2024
1c82793
Update slither output.
LeilaWang Mar 28, 2024
8d0c551
Fix source of artifect.
LeilaWang Mar 29, 2024
909dbc1
Create empty items for half full tuple.
LeilaWang Mar 29, 2024
a2a93a6
Validate before sort.
LeilaWang Mar 30, 2024
5e2d7c0
Update snapshots.
LeilaWang Mar 30, 2024
96cae60
Fix.
LeilaWang Mar 30, 2024
1d9e959
Sort note hashes after public tail.
LeilaWang Apr 1, 2024
5f4083f
Fix.
LeilaWang Apr 1, 2024
8425213
Merge remote-tracking branch 'origin/master' into lw/public_inputs_re…
LeilaWang Apr 3, 2024
d67c0d4
Update snapshot.
LeilaWang Apr 3, 2024
4404231
Update snapshot.
LeilaWang Apr 3, 2024
c84839a
Merge remote-tracking branch 'origin/master' into lw/public_inputs_re…
LeilaWang Apr 3, 2024
cc543f6
feat: wip - logs to side effects
MirandaWood Apr 8, 2024
50f61cc
feat: logs counters fixes + cleanup
MirandaWood Apr 11, 2024
d41d46f
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 11, 2024
7729d0a
chore: update fixtures, add errs for overflowing max logs, cleanup
MirandaWood Apr 11, 2024
a69ca48
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 11, 2024
ae4a5d5
chore: merge fixes, update snaps, fmt
MirandaWood Apr 12, 2024
c6acc47
fix: fixes for max logs in e2e, revert ordering e2e
MirandaWood Apr 12, 2024
c7ced5e
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 12, 2024
7011d8d
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 13, 2024
8c5267a
chore: fmt, add docs, add nr tests, cleanup
MirandaWood Apr 13, 2024
57e8c7b
fix: cleanup old hash imports
MirandaWood Apr 13, 2024
e197819
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 13, 2024
0059a6a
chore: cleanup merge changes
MirandaWood Apr 13, 2024
ed21691
fix: reinstate sorting hack in ts for pub tail
MirandaWood Apr 15, 2024
f4c51ce
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 15, 2024
bee6d1f
chore: fmt after merge
MirandaWood Apr 15, 2024
6c0c7a6
feat: rearrange context impls, cleanup unused code
MirandaWood Apr 15, 2024
228aa1f
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 15, 2024
ed99b52
chore: add todo
MirandaWood Apr 15, 2024
594e51c
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 15, 2024
b877ac0
chore: address comments
MirandaWood Apr 16, 2024
53de69d
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 16, 2024
dab4290
fix: clear logs for ts test
MirandaWood Apr 16, 2024
93e9ded
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 16, 2024
2ec011e
chore: update snaps, consts, fixtures
MirandaWood Apr 16, 2024
acf4221
chore: missing snap
MirandaWood Apr 16, 2024
0762d9b
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 17, 2024
b80fbd9
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 17, 2024
332bef7
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 17, 2024
c5dd383
fix: update deployer contract addr
MirandaWood Apr 17, 2024
0171b73
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 17, 2024
9c6eca8
fix: you guessed it, deployer addr update after merge
MirandaWood Apr 17, 2024
11be05c
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 17, 2024
8aa4377
fix: d e p l o y e r a d d r
MirandaWood Apr 17, 2024
df8bbae
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 17, 2024
411211a
Merge remote-tracking branch 'origin' into mw/logs-counter
MirandaWood Apr 17, 2024
70f76f3
chore: fmt
MirandaWood Apr 17, 2024
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
14 changes: 9 additions & 5 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ library Constants {
uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 2;
uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 2;
uint256 internal constant MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL = 1;
uint256 internal constant MAX_ENCRYPTED_LOGS_PER_CALL = 4;
uint256 internal constant MAX_UNENCRYPTED_LOGS_PER_CALL = 4;
uint256 internal constant MAX_NEW_NOTE_HASHES_PER_TX = 64;
uint256 internal constant MAX_NEW_NULLIFIERS_PER_TX = 64;
uint256 internal constant MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX = 8;
Expand All @@ -37,6 +39,8 @@ library Constants {
uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_TX = 8;
uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 8;
uint256 internal constant MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX = 4;
uint256 internal constant MAX_ENCRYPTED_LOGS_PER_TX = 8;
uint256 internal constant MAX_UNENCRYPTED_LOGS_PER_TX = 8;
uint256 internal constant NUM_ENCRYPTED_LOGS_HASHES_PER_TX = 1;
uint256 internal constant NUM_UNENCRYPTED_LOGS_HASHES_PER_TX = 1;
uint256 internal constant NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP = 16;
Expand Down Expand Up @@ -69,7 +73,7 @@ library Constants {
uint256 internal constant INITIAL_L2_BLOCK_NUM = 1;
uint256 internal constant BLOB_SIZE_IN_BYTES = 126976;
uint256 internal constant NESTED_CALL_L2_GAS_BUFFER = 20000;
uint256 internal constant MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 16000;
uint256 internal constant MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 16200;
uint256 internal constant MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS = 3000;
uint256 internal constant MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS = 3000;
uint256 internal constant REGISTERER_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS = 19;
Expand All @@ -83,7 +87,7 @@ library Constants {
uint256 internal constant DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE =
0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631;
uint256 internal constant DEPLOYER_CONTRACT_ADDRESS =
0x1df42e0457430b8d294d920181cc72ae0e3c5f8afd8d62d461bd26773cfdf3c1;
0x2ff51a7d821222276e750e72512920832a4392fe4e4aa2ceb11dc6f5626577a5;
uint256 internal constant L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH = 17;
uint256 internal constant MAX_NOTE_FIELDS_LENGTH = 20;
uint256 internal constant GET_NOTE_ORACLE_RETURN_LENGTH = 23;
Expand All @@ -110,9 +114,9 @@ library Constants {
uint256 internal constant NULLIFIER_KEY_VALIDATION_REQUEST_LENGTH = 4;
uint256 internal constant NULLIFIER_KEY_VALIDATION_REQUEST_CONTEXT_LENGTH = 5;
uint256 internal constant PARTIAL_STATE_REFERENCE_LENGTH = 6;
uint256 internal constant PRIVATE_CALL_STACK_ITEM_LENGTH = 221;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 218;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 209;
uint256 internal constant PRIVATE_CALL_STACK_ITEM_LENGTH = 235;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 232;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 216;
uint256 internal constant STATE_REFERENCE_LENGTH = 8;
uint256 internal constant TX_CONTEXT_DATA_LENGTH = 4;
uint256 internal constant TX_REQUEST_LENGTH = 8;
Expand Down
20 changes: 12 additions & 8 deletions l1-contracts/src/core/libraries/decoders/TxsDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,21 @@ library TxsDecoder {
uint256 privateCircuitPublicInputLogsLength = read4(_body, offset);
offset += 0x4;

// Hash the logs of this iteration's function call
bytes32 privateCircuitPublicInputsLogsHash =
Hash.sha256ToField(slice(_body, offset, privateCircuitPublicInputLogsLength));
offset += privateCircuitPublicInputLogsLength;

// Decrease remaining logs length by this privateCircuitPublicInputsLogs's length (len(I?_LOGS)) and 4 bytes for I?_LOGS_LEN
remainingLogsLength -= (privateCircuitPublicInputLogsLength + 0x4);

kernelPublicInputsLogsHash = Hash.sha256ToField(
bytes.concat(kernelPublicInputsLogsHash, privateCircuitPublicInputsLogsHash)
);
while (privateCircuitPublicInputLogsLength > 0) {
uint256 singleCallLogsLength = read4(_body, offset);
offset += 0x4;

bytes32 singleLogHash = Hash.sha256ToField(slice(_body, offset, singleCallLogsLength));
offset += singleCallLogsLength;

kernelPublicInputsLogsHash =
Hash.sha256ToField(bytes.concat(kernelPublicInputsLogsHash, singleLogHash));

privateCircuitPublicInputLogsLength -= (singleCallLogsLength + 0x4);
}
}

return (kernelPublicInputsLogsHash, offset);
Expand Down
46 changes: 21 additions & 25 deletions l1-contracts/test/decoders/Decoders.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -180,25 +180,20 @@ contract DecodersTest is DecoderBase {

(bytes32 logsHash, uint256 bytesAdvanced) = txsHelper.computeKernelLogsHash(encodedLogs);

bytes32 kernelPublicInputsLogsHash = bytes32(0);
bytes32 privateCircuitPublicInputsLogsHash = Hash.sha256ToField(new bytes(0));

bytes32 referenceLogsHash = Hash.sha256ToField(
abi.encodePacked(kernelPublicInputsLogsHash, privateCircuitPublicInputsLogsHash)
);

assertEq(bytesAdvanced, encodedLogs.length, "Advanced by an incorrect number of bytes");
assertEq(logsHash, referenceLogsHash, "Incorrect logs hash");
assertEq(logsHash, bytes32(0), "Incorrect logs hash");
}

function testComputeKernelLogs1Iteration() public {
// || K_LOGS_LEN | I1_LOGS_LEN | I1_LOGS ||
// K_LOGS_LEN = 4 + 8 = 12 (hex"0000000c")
// I1_LOGS_LEN = 8 (hex"00000008")
// I1_LOGS = 8 bytes (hex"0000000493e78a70") // Note: 00000004 is the length of 1 log within function logs
bytes memory firstFunctionCallLogs = hex"0000000493e78a70";
// I1_LOGS = 8 bytes (hex"0000000493e78a70")
bytes memory firstFunctionCallLogs = hex"93e78a70";
// Prefix logs with length of kernel logs (12) and length of iteration 1 logs (8)
bytes memory encodedLogs = abi.encodePacked(hex"0000000c00000008", firstFunctionCallLogs);
// Note: 00000004 is the length of 1 log within function logs
bytes memory encodedLogs =
abi.encodePacked(hex"0000000c00000008", hex"00000004", firstFunctionCallLogs);
(bytes32 logsHash, uint256 bytesAdvanced) = txsHelper.computeKernelLogsHash(encodedLogs);

// Zero because this is the first iteration
Expand All @@ -222,10 +217,15 @@ contract DecodersTest is DecoderBase {
// I1_LOGS = 8 random bytes (hex"0000000493e78a70")
// I2_LOGS_LEN = 20 (hex"00000014")
// I2_LOGS = 20 bytes (hex"0000001006a86173c86c6d3f108eefc36e7fb014")
bytes memory firstFunctionCallLogs = hex"0000000493e78a70";
bytes memory secondFunctionCallLogs = hex"0000001006a86173c86c6d3f108eefc36e7fb014";
bytes memory firstFunctionCallLogs = hex"93e78a70";
bytes memory secondFunctionCallLogs = hex"06a86173c86c6d3f108eefc36e7fb014";
bytes memory encodedLogs = abi.encodePacked(
hex"0000002400000008", firstFunctionCallLogs, hex"00000014", secondFunctionCallLogs
hex"0000002400000008",
hex"00000004",
firstFunctionCallLogs,
hex"00000014",
hex"00000010",
secondFunctionCallLogs
);
(bytes32 logsHash, uint256 bytesAdvanced) = txsHelper.computeKernelLogsHash(encodedLogs);

Expand Down Expand Up @@ -254,35 +254,31 @@ contract DecodersTest is DecoderBase {
// I2_LOGS = 0 bytes (hex"")
// I3_LOGS_LEN = 20 (hex"00000014")
// I3_LOGS = 20 random bytes (hex"0000001006a86173c86c6d3f108eefc36e7fb014")
bytes memory firstFunctionCallLogs = hex"0000000493e78a70";
bytes memory firstFunctionCallLogs = hex"93e78a70";
bytes memory secondFunctionCallLogs = hex"";
bytes memory thirdFunctionCallLogs = hex"0000001006a86173c86c6d3f108eefc36e7fb014";
bytes memory thirdFunctionCallLogs = hex"06a86173c86c6d3f108eefc36e7fb014";
bytes memory encodedLogs = abi.encodePacked(
hex"0000002800000008",
hex"00000004",
firstFunctionCallLogs,
hex"00000000",
secondFunctionCallLogs,
hex"00000014",
hex"00000010",
thirdFunctionCallLogs
);
(bytes32 logsHash, uint256 bytesAdvanced) = txsHelper.computeKernelLogsHash(encodedLogs);

bytes32 referenceLogsHashFromIteration1 =
Hash.sha256ToField(abi.encodePacked(bytes32(0), Hash.sha256ToField(firstFunctionCallLogs)));

bytes32 privateCircuitPublicInputsLogsHashSecondCall =
Hash.sha256ToField(secondFunctionCallLogs);

bytes32 referenceLogsHashFromIteration2 = Hash.sha256ToField(
abi.encodePacked(
referenceLogsHashFromIteration1, privateCircuitPublicInputsLogsHashSecondCall
)
);
// Note: as of resolving #5017, we now hash logs inside the circuits
// Following the YP, we skip any zero length logs, hence no use of secondFunctionCallLogs here

bytes32 privateCircuitPublicInputsLogsHashThirdCall = Hash.sha256ToField(thirdFunctionCallLogs);

bytes32 referenceLogsHashFromIteration3 = Hash.sha256ToField(
abi.encodePacked(referenceLogsHashFromIteration2, privateCircuitPublicInputsLogsHashThirdCall)
abi.encodePacked(referenceLogsHashFromIteration1, privateCircuitPublicInputsLogsHashThirdCall)
);

assertEq(bytesAdvanced, encodedLogs.length, "Advanced by an incorrect number of bytes");
Expand Down
10 changes: 5 additions & 5 deletions l1-contracts/test/fixtures/empty_block_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x2ea0c3d3ffef649532de4fb75c9135681ef65b926876b5ff37a4bacfb679f558",
"archive": "0x2683d379c0ad62e225372f35b74366d8c3cd145a12dbbb2028456da89f889be1",
"body": "0x00000000",
"txsEffectsHash": "0x00df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d2493896",
"decodedHeader": {
Expand All @@ -23,8 +23,8 @@
"chainId": 31337,
"timestamp": 0,
"version": 1,
"coinbase": "0xf6a7844f33ced45fbfeaa9ba463a706b30d4c454",
"feeRecipient": "0x115f6d9664fe6497dec1741573007fcd96fc24124e05b2d415fe4e43e0de4d6e",
"coinbase": "0xd70b960abd35f82aac6df2d1ca6617b5bcd95ba5",
"feeRecipient": "0x0c67b9f94de6beccefc03b63ba448b53464348836ef20b3e6183c5d4f85653ee",
"gasFees": {
"feePerDaGas": 0,
"feePerL1Gas": 0,
Expand Down Expand Up @@ -56,8 +56,8 @@
}
}
},
"header": "0x05b0b6df52f1d47d0406318558052c89a174fbc9d615def82b3cc9ccc1937db800000001000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000001016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000000800bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001000572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000800000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f6a7844f33ced45fbfeaa9ba463a706b30d4c454115f6d9664fe6497dec1741573007fcd96fc24124e05b2d415fe4e43e0de4d6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x000150a504a83df5a4a24f26081fb7397809f2ef5976b687fbdeefb5d42da7f3",
"header": "0x05b0b6df52f1d47d0406318558052c89a174fbc9d615def82b3cc9ccc1937db800000001000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000001016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000000800bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001000572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000800000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000d70b960abd35f82aac6df2d1ca6617b5bcd95ba50c67b9f94de6beccefc03b63ba448b53464348836ef20b3e6183c5d4f85653ee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00ee6ce1f8afb6a9d9da7165bbff8d03d3f2e4ae6a65a9265ecbb7c600244a9c",
"numTxs": 0
}
}
14 changes: 7 additions & 7 deletions l1-contracts/test/fixtures/empty_block_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x20411bada543bf4a76e1e2b96c15059c7c81b81b4dec36b15102bcc72dfdebff",
"archive": "0x0be67a10fc9ab9372e7fdfa4fcce95a3ed24d42fb6694ffcd3d418d504d8fef4",
"body": "0x00000000",
"txsEffectsHash": "0x00df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d2493896",
"decodedHeader": {
Expand All @@ -21,10 +21,10 @@
"globalVariables": {
"blockNumber": 2,
"chainId": 31337,
"timestamp": 1712782698,
"timestamp": 1712912168,
"version": 1,
"coinbase": "0xf6a7844f33ced45fbfeaa9ba463a706b30d4c454",
"feeRecipient": "0x115f6d9664fe6497dec1741573007fcd96fc24124e05b2d415fe4e43e0de4d6e",
"coinbase": "0xd70b960abd35f82aac6df2d1ca6617b5bcd95ba5",
"feeRecipient": "0x0c67b9f94de6beccefc03b63ba448b53464348836ef20b3e6183c5d4f85653ee",
"gasFees": {
"feePerDaGas": 0,
"feePerL1Gas": 0,
Expand All @@ -33,7 +33,7 @@
},
"lastArchive": {
"nextAvailableLeafIndex": 2,
"root": "0x2ea0c3d3ffef649532de4fb75c9135681ef65b926876b5ff37a4bacfb679f558"
"root": "0x2683d379c0ad62e225372f35b74366d8c3cd145a12dbbb2028456da89f889be1"
},
"stateReference": {
"l1ToL2MessageTree": {
Expand All @@ -56,8 +56,8 @@
}
}
},
"header": "0x2ea0c3d3ffef649532de4fb75c9135681ef65b926876b5ff37a4bacfb679f55800000002000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000002016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000001000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000c00000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000006616fd6af6a7844f33ced45fbfeaa9ba463a706b30d4c454115f6d9664fe6497dec1741573007fcd96fc24124e05b2d415fe4e43e0de4d6e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00da6d809b78297d6f97202d0679da5a45cfbc2c6594eaeb3f0ac4deba7c6b2e",
"header": "0x2683d379c0ad62e225372f35b74366d8c3cd145a12dbbb2028456da89f889be100000002000000000000000000000000000000000000000000000000000000000000000100df6b1c97b9e01113fa0363d9ff71c85addc74e92b22d433b2fb082d249389600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c31864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f800000002016642d9ccd8346c403aa4c3fa451178b22534a27035cdaa6ec34ae53b29c50cb000001000bcfa3e9f1a8922ee92c6dc964d6595907c1804a86753774322b468f69d4f278000001800572c8db882674dd026b8877fbba1b700a4407da3ae9ce5fa43215a28163362b000000c00000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000006618f728d70b960abd35f82aac6df2d1ca6617b5bcd95ba50c67b9f94de6beccefc03b63ba448b53464348836ef20b3e6183c5d4f85653ee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00bb8af4db44612602143f2507b6f07f4dc5fdede045494a1467c4bea354bcae",
"numTxs": 0
}
}
10 changes: 5 additions & 5 deletions l1-contracts/test/fixtures/mixed_block_0.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions l1-contracts/test/fixtures/mixed_block_1.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions noir-projects/aztec-nr/aztec/src/context/avm_context.nr
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl AvmContext {
* Should be automatically convertible to [Field; N]. For example str<N> works with
* one char per field. Otherwise you can use CompressedString.
*/
pub fn accumulate_unencrypted_logs<T>(&mut self, event_selector: Field, log: T) {
pub fn emit_unencrypted_log<T>(&mut self, event_selector: Field, log: T) {
emit_unencrypted_log(event_selector, log);
}
pub fn note_hash_exists(self, note_hash: Field, leaf_index: Field) -> bool {
Expand Down Expand Up @@ -130,13 +130,13 @@ impl PublicContextInterface for AvmContext {
assert(false, "'push_nullifier_non_existent_read_request' not implemented!");
}

fn accumulate_encrypted_logs<N>(&mut self, log: [Field; N]) {
assert(false, "'accumulate_encrypted_logs' not implemented!");
fn emit_unencrypted_log<T>(&mut self, log: T) {
let event_selector = 0;
self.emit_unencrypted_log(event_selector, log);
}

fn accumulate_unencrypted_logs<T>(&mut self, log: T) {
let event_selector = 0;
self.accumulate_unencrypted_logs(event_selector, log);
fn push_unencrypted_log(&mut self, log_hash: Field) {
assert(false, "'push_unencrypted_log' not required for avm - use emit_unencrypted_log!");
}

fn consume_l1_to_l2_message(&mut self, content: Field, secret: Field, sender: EthAddress) {
Expand Down
4 changes: 2 additions & 2 deletions noir-projects/aztec-nr/aztec/src/context/interface.nr
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ trait PublicContextInterface {
fn push_nullifier_non_existent_read_request(&mut self, nullifier: Field);
fn message_portal(&mut self, recipient: EthAddress, content: Field);
fn consume_l1_to_l2_message(&mut self, content: Field, secret: Field, sender: EthAddress);
fn accumulate_encrypted_logs<N>(&mut self, log: [Field; N]);
fn accumulate_unencrypted_logs<T>(&mut self, log: T);
fn emit_unencrypted_log<T>(&mut self, log: T);
MirandaWood marked this conversation as resolved.
Show resolved Hide resolved
fn push_unencrypted_log(&mut self, log_hash: Field);
fn call_public_function<ARGS_COUNT, RETURNS_COUNT>(
self: &mut Self,
contract_address: AztecAddress,
Expand Down
Loading
Loading