Skip to content

Commit a415f65

Browse files
authored
fix: Revert "feat: blobs. (#9302)" (#10187)
This reverts commit 03b7e0e. (womp womp)
1 parent a9f3b5f commit a415f65

File tree

128 files changed

+11034
-17443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+11034
-17443
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
concurrency_key: build-x86
158158
# prepare images locally, tagged by commit hash
159159
- name: "Build E2E Image"
160-
timeout-minutes: 90
160+
timeout-minutes: 40
161161
if: (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master'
162162
run: |
163163
earthly-ci ./yarn-project+export-e2e-test-images

l1-contracts/src/core/Rollup.sol

+78-216
Large diffs are not rendered by default.

l1-contracts/src/core/interfaces/IRollup.sol

+9-6
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ interface IRollup {
3636
function propose(
3737
ProposeArgs calldata _args,
3838
SignatureLib.Signature[] memory _signatures,
39-
bytes calldata _body,
40-
bytes calldata _blobInput
39+
bytes calldata _body
4140
) external;
4241

4342
function proposeAndClaim(
4443
ProposeArgs calldata _args,
4544
SignatureLib.Signature[] memory _signatures,
4645
bytes calldata _body,
47-
bytes calldata _blobInput,
4846
EpochProofQuoteLib.SignedEpochProofQuote calldata _quote
4947
) external;
5048

5149
function submitEpochRootProof(
52-
DataStructures.SubmitProofArgs calldata _submitArgs,
50+
uint256 _epochSize,
51+
bytes32[7] calldata _args,
52+
bytes32[] calldata _fees,
5353
bytes calldata _aggregationObject,
5454
bytes calldata _proof
5555
) external;
@@ -61,7 +61,7 @@ interface IRollup {
6161
SignatureLib.Signature[] memory _signatures,
6262
bytes32 _digest,
6363
Timestamp _currentTime,
64-
bytes32 _blobsHash,
64+
bytes32 _txsEffecstHash,
6565
DataStructures.ExecutionFlags memory _flags
6666
) external view;
6767

@@ -105,7 +105,10 @@ interface IRollup {
105105
) external view;
106106
function getEpochForBlock(uint256 _blockNumber) external view returns (Epoch);
107107
function getEpochProofPublicInputs(
108-
DataStructures.SubmitProofArgs calldata _submitArgs,
108+
uint256 _epochSize,
109+
bytes32[7] calldata _args,
110+
bytes32[] calldata _fees,
109111
bytes calldata _aggregationObject
110112
) external view returns (bytes32[] memory);
113+
function computeTxsEffectsHash(bytes calldata _body) external pure returns (bytes32);
111114
}

l1-contracts/src/core/libraries/ConstantsGen.sol

+4-20
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ library Constants {
9292
uint256 internal constant FUNCTION_SELECTOR_NUM_BYTES = 4;
9393
uint256 internal constant INITIALIZATION_SLOT_SEPARATOR = 1000000000;
9494
uint256 internal constant INITIAL_L2_BLOCK_NUM = 1;
95-
uint256 internal constant FIELDS_PER_BLOB = 4096;
96-
uint256 internal constant BLOBS_PER_BLOCK = 3;
9795
uint256 internal constant PRIVATE_LOG_SIZE_IN_BYTES = 576;
96+
uint256 internal constant BLOB_SIZE_IN_BYTES = 126976;
9897
uint256 internal constant AZTEC_MAX_EPOCH_DURATION = 32;
9998
uint256 internal constant GENESIS_ARCHIVE_ROOT =
10099
19007378675971183768036762391356802220352606103602592933942074152320327194720;
@@ -171,9 +170,6 @@ library Constants {
171170
uint256 internal constant FUNCTION_LEAF_PREIMAGE_LENGTH = 5;
172171
uint256 internal constant GLOBAL_VARIABLES_LENGTH = 9;
173172
uint256 internal constant APPEND_ONLY_TREE_SNAPSHOT_LENGTH = 2;
174-
uint256 internal constant APPEND_ONLY_TREE_SNAPSHOT_LENGTH_BYTES = 36;
175-
uint256 internal constant SPONGE_BLOB_LENGTH = 11;
176-
uint256 internal constant BLOB_PUBLIC_INPUTS = 6;
177173
uint256 internal constant L1_TO_L2_MESSAGE_LENGTH = 6;
178174
uint256 internal constant L2_TO_L1_MESSAGE_LENGTH = 3;
179175
uint256 internal constant SCOPED_L2_TO_L1_MESSAGE_LENGTH = 4;
@@ -206,7 +202,6 @@ library Constants {
206202
uint256 internal constant TX_REQUEST_LENGTH = 12;
207203
uint256 internal constant TOTAL_FEES_LENGTH = 1;
208204
uint256 internal constant HEADER_LENGTH = 24;
209-
uint256 internal constant HEADER_LENGTH_BYTES = 616;
210205
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 490;
211206
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 866;
212207
uint256 internal constant PRIVATE_CONTEXT_INPUTS_LENGTH = 37;
@@ -226,9 +221,9 @@ library Constants {
226221
uint256 internal constant PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 1140;
227222
uint256 internal constant KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 605;
228223
uint256 internal constant CONSTANT_ROLLUP_DATA_LENGTH = 13;
229-
uint256 internal constant BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 51;
230-
uint256 internal constant BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH = 666;
231-
uint256 internal constant ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH = 652;
224+
uint256 internal constant BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 30;
225+
uint256 internal constant BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH = 90;
226+
uint256 internal constant ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH = 76;
232227
uint256 internal constant GET_NOTES_ORACLE_RETURN_LENGTH = 674;
233228
uint256 internal constant NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP = 2048;
234229
uint256 internal constant NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP = 2048;
@@ -277,17 +272,6 @@ library Constants {
277272
uint256 internal constant START_EMIT_NULLIFIER_WRITE_OFFSET = 208;
278273
uint256 internal constant START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 224;
279274
uint256 internal constant START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 226;
280-
uint256 internal constant TX_START_PREFIX = 8392562855083340404;
281-
uint256 internal constant REVERT_CODE_PREFIX = 1;
282-
uint256 internal constant TX_FEE_PREFIX = 2;
283-
uint256 internal constant NOTES_PREFIX = 3;
284-
uint256 internal constant NULLIFIERS_PREFIX = 4;
285-
uint256 internal constant L2_L1_MSGS_PREFIX = 5;
286-
uint256 internal constant PUBLIC_DATA_UPDATE_REQUESTS_PREFIX = 6;
287-
uint256 internal constant NOTE_ENCRYPTED_LOGS_PREFIX = 7;
288-
uint256 internal constant ENCRYPTED_LOGS_PREFIX = 8;
289-
uint256 internal constant UNENCRYPTED_LOGS_PREFIX = 9;
290-
uint256 internal constant CONTRACT_CLASS_LOGS_PREFIX = 10;
291275
uint256 internal constant PROOF_TYPE_PLONK = 0;
292276
uint256 internal constant PROOF_TYPE_HONK = 1;
293277
uint256 internal constant PROOF_TYPE_OINK = 2;

l1-contracts/src/core/libraries/DataStructures.sol

-14
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,4 @@ library DataStructures {
9292
address bondProvider;
9393
address proposerClaimant;
9494
}
95-
96-
/**
97-
* @notice Struct for submitting the Epoch Proof
98-
* @param epochSize - The size of the epoch (to be promoted to a constant)
99-
* @param args - Array of public inputs to the proof (previousArchive, endArchive, previousBlockHash, endBlockHash, endTimestamp, outHash, proverId)
100-
* @param fees - Array of recipient-value pairs with fees to be distributed for the epoch
101-
* @param blobPublicInputs- The blob PIs for the proof
102-
*/
103-
struct SubmitProofArgs {
104-
uint256 epochSize;
105-
bytes32[7] args;
106-
bytes32[] fees;
107-
bytes blobPublicInputs;
108-
}
10995
}

l1-contracts/src/core/libraries/Errors.sol

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ library Errors {
6060
error Rollup__InvalidProposedArchive(bytes32 expected, bytes32 actual); // 0x32532e73
6161
error Rollup__InvalidTimestamp(Timestamp expected, Timestamp actual); // 0x3132e895
6262
error Rollup__InvalidVersion(uint256 expected, uint256 actual); // 0x9ef30794
63-
error Rollup__InvalidBlobHash(bytes32 blobHash); // 0xc4a168c6
64-
error Rollup__InvalidBlobProof(bytes32 blobHash); // 0x5ca17bef
65-
error Rollup__InvalidBlobPublicInputsHash(bytes32 expected, bytes32 actual); // 0xfe6b4994
6663
error Rollup__NoEpochToProve(); // 0xcbaa3951
6764
error Rollup__NonSequentialProving(); // 0x1e5be132
6865
error Rollup__NotClaimingCorrectEpoch(Epoch expected, Epoch actual); // 0xf0e0744d
@@ -79,6 +76,10 @@ library Errors {
7976
error Rollup__NonZeroL2Fee(); // 0x7e728abc
8077
error Rollup__InvalidBasisPointFee(uint256 basisPointFee); // 0x4292d136
8178

79+
//TxsDecoder
80+
error TxsDecoder__InvalidLogsLength(uint256 expected, uint256 actual); // 0x829ca981
81+
error TxsDecoder__TxsTooLarge(uint256 expected, uint256 actual); // 0xc7d44a62
82+
8283
// HeaderLib
8384
error HeaderLib__InvalidHeaderSize(uint256 expected, uint256 actual); // 0xf3ccb247
8485
error HeaderLib__InvalidSlotNumber(Slot expected, Slot actual); // 0x09ba91ff

l1-contracts/src/core/libraries/HeaderLib.sol

+78-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {Errors} from "@aztec/core/libraries/Errors.sol";
2424
* | 0x0020 | 0x04 | lastArchive.nextAvailableLeafIndex
2525
* | | | ContentCommitment {
2626
* | 0x0024 | 0x20 | numTxs
27-
* | 0x0044 | 0x20 | blobsHash
27+
* | 0x0044 | 0x20 | txsEffectsHash
2828
* | 0x0064 | 0x20 | inHash
2929
* | 0x0084 | 0x20 | outHash
3030
* | | | StateReference {
@@ -91,7 +91,7 @@ library HeaderLib {
9191

9292
struct ContentCommitment {
9393
uint256 numTxs;
94-
bytes32 blobsHash;
94+
bytes32 txsEffectsHash;
9595
bytes32 inHash;
9696
bytes32 outHash;
9797
}
@@ -104,7 +104,7 @@ library HeaderLib {
104104
uint256 totalFees;
105105
}
106106

107-
uint256 private constant HEADER_LENGTH = Constants.HEADER_LENGTH_BYTES; // Header byte length
107+
uint256 private constant HEADER_LENGTH = 0x268; // Header byte length
108108

109109
/**
110110
* @notice Decodes the header
@@ -126,7 +126,7 @@ library HeaderLib {
126126

127127
// Reading ContentCommitment
128128
header.contentCommitment.numTxs = uint256(bytes32(_header[0x0024:0x0044]));
129-
header.contentCommitment.blobsHash = bytes32(_header[0x0044:0x0064]);
129+
header.contentCommitment.txsEffectsHash = bytes32(_header[0x0044:0x0064]);
130130
header.contentCommitment.inHash = bytes32(_header[0x0064:0x0084]);
131131
header.contentCommitment.outHash = bytes32(_header[0x0084:0x00a4]);
132132

@@ -160,4 +160,78 @@ library HeaderLib {
160160

161161
return header;
162162
}
163+
164+
function toFields(Header memory _header) internal pure returns (bytes32[] memory) {
165+
bytes32[] memory fields = new bytes32[](24);
166+
167+
// must match the order in the Header.getFields
168+
fields[0] = _header.lastArchive.root;
169+
fields[1] = bytes32(uint256(_header.lastArchive.nextAvailableLeafIndex));
170+
fields[2] = bytes32(_header.contentCommitment.numTxs);
171+
fields[3] = _header.contentCommitment.txsEffectsHash;
172+
fields[4] = _header.contentCommitment.inHash;
173+
fields[5] = _header.contentCommitment.outHash;
174+
fields[6] = _header.stateReference.l1ToL2MessageTree.root;
175+
fields[7] = bytes32(uint256(_header.stateReference.l1ToL2MessageTree.nextAvailableLeafIndex));
176+
fields[8] = _header.stateReference.partialStateReference.noteHashTree.root;
177+
fields[9] = bytes32(
178+
uint256(_header.stateReference.partialStateReference.noteHashTree.nextAvailableLeafIndex)
179+
);
180+
fields[10] = _header.stateReference.partialStateReference.nullifierTree.root;
181+
fields[11] = bytes32(
182+
uint256(_header.stateReference.partialStateReference.nullifierTree.nextAvailableLeafIndex)
183+
);
184+
fields[12] = _header.stateReference.partialStateReference.publicDataTree.root;
185+
fields[13] = bytes32(
186+
uint256(_header.stateReference.partialStateReference.publicDataTree.nextAvailableLeafIndex)
187+
);
188+
fields[14] = bytes32(_header.globalVariables.chainId);
189+
fields[15] = bytes32(_header.globalVariables.version);
190+
fields[16] = bytes32(_header.globalVariables.blockNumber);
191+
fields[17] = bytes32(_header.globalVariables.slotNumber);
192+
fields[18] = bytes32(_header.globalVariables.timestamp);
193+
fields[19] = bytes32(uint256(uint160(_header.globalVariables.coinbase)));
194+
fields[20] = bytes32(_header.globalVariables.feeRecipient);
195+
fields[21] = bytes32(_header.globalVariables.gasFees.feePerDaGas);
196+
fields[22] = bytes32(_header.globalVariables.gasFees.feePerL2Gas);
197+
fields[23] = bytes32(_header.totalFees);
198+
199+
// fail if the header structure has changed without updating this function
200+
require(
201+
fields.length == Constants.HEADER_LENGTH,
202+
Errors.HeaderLib__InvalidHeaderSize(Constants.HEADER_LENGTH, fields.length)
203+
);
204+
205+
return fields;
206+
}
207+
208+
// TODO(#7346): Currently using the below to verify block root proofs until batch rollups fully integrated.
209+
// Once integrated, remove the below fn (not used anywhere else).
210+
function toFields(GlobalVariables memory _globalVariables)
211+
internal
212+
pure
213+
returns (bytes32[] memory)
214+
{
215+
bytes32[] memory fields = new bytes32[](Constants.GLOBAL_VARIABLES_LENGTH);
216+
217+
fields[0] = bytes32(_globalVariables.chainId);
218+
fields[1] = bytes32(_globalVariables.version);
219+
fields[2] = bytes32(_globalVariables.blockNumber);
220+
fields[3] = bytes32(_globalVariables.slotNumber);
221+
fields[4] = bytes32(_globalVariables.timestamp);
222+
fields[5] = bytes32(uint256(uint160(_globalVariables.coinbase)));
223+
fields[6] = bytes32(_globalVariables.feeRecipient);
224+
fields[7] = bytes32(_globalVariables.gasFees.feePerDaGas);
225+
fields[8] = bytes32(_globalVariables.gasFees.feePerL2Gas);
226+
227+
// fail if the header structure has changed without updating this function
228+
// TODO(Miranda): Temporarily using this method and below error while block-root proofs are verified
229+
// When we verify root proofs, this method can be removed => no need for separate named error
230+
require(
231+
fields.length == Constants.GLOBAL_VARIABLES_LENGTH,
232+
Errors.HeaderLib__InvalidHeaderSize(Constants.HEADER_LENGTH, fields.length)
233+
);
234+
235+
return fields;
236+
}
163237
}

0 commit comments

Comments
 (0)