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: drop epoch duration / block times #9149

Merged
merged 6 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion l1-contracts/src/core/Rollup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Leonidas, IRollup, ITestRollup {

// See https://github.com/AztecProtocol/engineering-designs/blob/main/in-progress/8401-proof-timeliness/proof-timeliness.ipynb
// for justification of CLAIM_DURATION_IN_L2_SLOTS.
uint256 public constant CLAIM_DURATION_IN_L2_SLOTS = 13;
uint256 public constant CLAIM_DURATION_IN_L2_SLOTS =
Constants.AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS;
uint256 public constant PROOF_COMMITMENT_MIN_BOND_AMOUNT_IN_TST = 1000;

uint256 public immutable L1_BLOCK_AT_GENESIS;
Expand Down
9 changes: 5 additions & 4 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ library Constants {
uint256 internal constant INITIAL_L2_BLOCK_NUM = 1;
uint256 internal constant BLOB_SIZE_IN_BYTES = 126976;
uint256 internal constant ETHEREUM_SLOT_DURATION = 12;
uint256 internal constant AZTEC_SLOT_DURATION = 36;
uint256 internal constant AZTEC_EPOCH_DURATION = 48;
uint256 internal constant AZTEC_SLOT_DURATION = 24;
uint256 internal constant AZTEC_EPOCH_DURATION = 16;
uint256 internal constant AZTEC_TARGET_COMMITTEE_SIZE = 48;
uint256 internal constant AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS = 13;
uint256 internal constant GENESIS_ARCHIVE_ROOT =
8142738430000951296386584486068033372964809139261822027365426310856631083550;
uint256 internal constant FEE_JUICE_INITIAL_MINT = 20000000000;
Expand Down Expand Up @@ -211,8 +212,8 @@ library Constants {
uint256 internal constant KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 664;
uint256 internal constant CONSTANT_ROLLUP_DATA_LENGTH = 13;
uint256 internal constant BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 30;
uint256 internal constant BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH = 124;
uint256 internal constant ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH = 108;
uint256 internal constant BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH = 60;
uint256 internal constant ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH = 44;
uint256 internal constant GET_NOTES_ORACLE_RETURN_LENGTH = 674;
uint256 internal constant NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP = 2048;
uint256 internal constant NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP = 2048;
Expand Down
16 changes: 8 additions & 8 deletions l1-contracts/test/fixtures/empty_block_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x297eae831bd111157e6a0ca9a2b308582d40fe6df08b8783589f71689411f25c",
"blockHash": "0x198acc9f0edfeb7a35254bc6fbc0ebbd37a56c790ed080da3029c84d20c76dc4",
"archive": "0x18589e53843baf9415aa9a4943bd4d8fa19b318329604f51a4ac0b8e7eb8e155",
"blockHash": "0x2662dae080808aceafe3377c439d8bea968d5ea74c98643adf5c2ea805f72c0c",
"body": "0x00000000",
"txsEffectsHash": "0x00e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d6",
"decodedHeader": {
Expand All @@ -21,12 +21,12 @@
},
"globalVariables": {
"blockNumber": 1,
"slotNumber": "0x0000000000000000000000000000000000000000000000000000000000000031",
"slotNumber": "0x0000000000000000000000000000000000000000000000000000000000000011",
"chainId": 31337,
"timestamp": 1727209981,
"timestamp": 1728563130,
"version": 1,
"coinbase": "0x48820dbe0aca89d270282a8f2b96858e4a02fd86",
"feeRecipient": "0x09507465bcdd9b36079acdd4d16c54325ec118241ae4d9d36d5b8c4a553a2bd4",
"coinbase": "0xd498444361455d5099a036e93f395a584cf085c6",
"feeRecipient": "0x07c66a9b410a7e26824d677a12d8af977c0db64e5fcdfc8ad704c71c0267d649",
"gasFees": {
"feePerDaGas": 0,
"feePerL2Gas": 0
Expand Down Expand Up @@ -57,8 +57,8 @@
}
}
},
"header": "0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e00000001000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3000000100b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d0000008019a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc0000010023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001000000000000000000000000000000000000000000000000000000000000007a690000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000310000000000000000000000000000000000000000000000000000000066f321fd48820dbe0aca89d270282a8f2b96858e4a02fd8609507465bcdd9b36079acdd4d16c54325ec118241ae4d9d36d5b8c4a553a2bd4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x004bfba06ac34bf94241679ac67b1d0feaba3974ffaa89130178f856f9dde151",
"header": "0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e00000001000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3000000100b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d0000008019a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc0000010023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001000000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000006707c7bad498444361455d5099a036e93f395a584cf085c607c66a9b410a7e26824d677a12d8af977c0db64e5fcdfc8ad704c71c0267d649000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00e081da850e07688f3b8eac898caaeb80fabf215e1c87bbecc180d88a19f34e",
"numTxs": 0
}
}
18 changes: 9 additions & 9 deletions l1-contracts/test/fixtures/empty_block_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x27051db35349c7cce24904a49415ce16cdcca25ee7f4b008a0b61fc9085bfb59",
"blockHash": "0x085125d283a90ef5f0f76f86842d1ecb6e012435a574cc9db61c97890822d4ae",
"archive": "0x1d3dc82359e412945750080a10eede5c3ee3cb9360dc3ca35dda2c5f2e296c52",
"blockHash": "0x15fb8c7900432692f9f4e590e6df42d6fff4ce24f0b720514d6bc30ba234d548",
"body": "0x00000000",
"txsEffectsHash": "0x00e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d6",
"decodedHeader": {
Expand All @@ -21,20 +21,20 @@
},
"globalVariables": {
"blockNumber": 2,
"slotNumber": "0x0000000000000000000000000000000000000000000000000000000000000032",
"slotNumber": "0x0000000000000000000000000000000000000000000000000000000000000012",
"chainId": 31337,
"timestamp": 1727210017,
"timestamp": 1728563154,
"version": 1,
"coinbase": "0x48820dbe0aca89d270282a8f2b96858e4a02fd86",
"feeRecipient": "0x09507465bcdd9b36079acdd4d16c54325ec118241ae4d9d36d5b8c4a553a2bd4",
"coinbase": "0xd498444361455d5099a036e93f395a584cf085c6",
"feeRecipient": "0x07c66a9b410a7e26824d677a12d8af977c0db64e5fcdfc8ad704c71c0267d649",
"gasFees": {
"feePerDaGas": 0,
"feePerL2Gas": 0
}
},
"lastArchive": {
"nextAvailableLeafIndex": 2,
"root": "0x297eae831bd111157e6a0ca9a2b308582d40fe6df08b8783589f71689411f25c"
"root": "0x18589e53843baf9415aa9a4943bd4d8fa19b318329604f51a4ac0b8e7eb8e155"
},
"stateReference": {
"l1ToL2MessageTree": {
Expand All @@ -57,8 +57,8 @@
}
}
},
"header": "0x297eae831bd111157e6a0ca9a2b308582d40fe6df08b8783589f71689411f25c00000002000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3000000200b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d0000010019a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc0000018023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001800000000000000000000000000000000000000000000000000000000000007a690000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000066f3222148820dbe0aca89d270282a8f2b96858e4a02fd8609507465bcdd9b36079acdd4d16c54325ec118241ae4d9d36d5b8c4a553a2bd4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00cf034eb8c87c0608a9a3b0bb8685b1ae401527c72f171438c83bceaf792d84",
"header": "0x18589e53843baf9415aa9a4943bd4d8fa19b318329604f51a4ac0b8e7eb8e15500000002000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3000000200b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d0000010019a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc0000018023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001800000000000000000000000000000000000000000000000000000000000007a69000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000006707c7d2d498444361455d5099a036e93f395a584cf085c607c66a9b410a7e26824d677a12d8af977c0db64e5fcdfc8ad704c71c0267d649000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00815a814be4b3e0ac1a671e1a0321c231ac90e23ef7b2b1e411d32a2fb1948d",
"numTxs": 0
}
}
16 changes: 8 additions & 8 deletions l1-contracts/test/fixtures/mixed_block_1.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions l1-contracts/test/fixtures/mixed_block_2.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ global INITIAL_L2_BLOCK_NUM: Field = 1;
global BLOB_SIZE_IN_BYTES: Field = 31 * 4096;
global ETHEREUM_SLOT_DURATION: u32 = 12;
// AZTEC_SLOT_DURATION should be a multiple of ETHEREUM_SLOT_DURATION
global AZTEC_SLOT_DURATION: u32 = ETHEREUM_SLOT_DURATION * 3;
global AZTEC_EPOCH_DURATION: u32 = 48;
global AZTEC_SLOT_DURATION: u32 = ETHEREUM_SLOT_DURATION * 2;
global AZTEC_EPOCH_DURATION: u32 = 16;
global AZTEC_TARGET_COMMITTEE_SIZE: u32 = 48;
// The number of AZTEC_SLOTS that we can wait for a proof of an epoch to be produced.
global AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS: u32 = 13;
// The following is taken from building a block and looking at the `lastArchive` value in it.
// You can run the `integration_l1_publisher.test.ts` and look at the first blocks in the fixtures.
global GENESIS_ARCHIVE_ROOT: Field = 0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e;
Expand Down
9 changes: 5 additions & 4 deletions yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ export const INITIALIZATION_SLOT_SEPARATOR = 1000000000;
export const INITIAL_L2_BLOCK_NUM = 1;
export const BLOB_SIZE_IN_BYTES = 126976;
export const ETHEREUM_SLOT_DURATION = 12;
export const AZTEC_SLOT_DURATION = 36;
export const AZTEC_EPOCH_DURATION = 48;
export const AZTEC_SLOT_DURATION = 24;
export const AZTEC_EPOCH_DURATION = 16;
export const AZTEC_TARGET_COMMITTEE_SIZE = 48;
export const AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS = 13;
export const GENESIS_ARCHIVE_ROOT = 8142738430000951296386584486068033372964809139261822027365426310856631083550n;
export const FEE_JUICE_INITIAL_MINT = 20000000000;
export const PUBLIC_DISPATCH_SELECTOR = 3578010381;
Expand Down Expand Up @@ -196,8 +197,8 @@ export const VM_CIRCUIT_PUBLIC_INPUTS_LENGTH = 2472;
export const KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 664;
export const CONSTANT_ROLLUP_DATA_LENGTH = 13;
export const BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 30;
export const BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH = 124;
export const ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH = 108;
export const BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH = 60;
export const ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH = 44;
export const GET_NOTES_ORACLE_RETURN_LENGTH = 674;
export const NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP = 2048;
export const NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP = 2048;
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/end-to-end/src/e2e_avm_simulator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('e2e_avm_simulator', () => {
let teardown: () => Promise<void>;

beforeAll(async () => {
({ teardown, wallet } = await setup());
({ teardown, wallet } = await setup(undefined, {
assumeProvenThrough: Number.MAX_SAFE_INTEGER,
}));
await ensureAccountsPubliclyDeployed(wallet, [wallet]);
});

Expand Down
6 changes: 3 additions & 3 deletions yarn-project/end-to-end/src/e2e_synching.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ const variants: VariantDefinition[] = [
{ blockCount: 1000, txCount: 4, txComplexity: TxComplexity.PrivateTransfer },
];

describe('e2e_synching', () => {
describe.skip('e2e_synching', () => {
// WARNING: Running this with AZTEC_GENERATE_TEST_DATA is VERY slow, and will build a whole slew
// of fixtures including multiple blocks with many transaction in.
it.each(variants)(
Expand Down Expand Up @@ -453,7 +453,7 @@ describe('e2e_synching', () => {
await teardown();
};

describe('replay history and then do a fresh sync', () => {
describe.skip('replay history and then do a fresh sync', () => {
it.each(variants)(
'vanilla - %s',
async (variantDef: VariantDefinition) => {
Expand Down Expand Up @@ -490,7 +490,7 @@ describe('e2e_synching', () => {
);
});

describe('a wild prune appears', () => {
describe.skip('a wild prune appears', () => {
const ASSUME_PROVEN_THROUGH = 0;

it('archiver following catches reorg as it occur and deletes blocks', async () => {
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/end-to-end/src/fixtures/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ export type EndToEndContext = {
*/
export async function setup(
numberOfAccounts = 1,
opts: SetupOptions = {},
opts: SetupOptions = {
assumeProvenThrough: Number.MAX_SAFE_INTEGER,
},
pxeOpts: Partial<PXEServiceConfig> = {},
chain: Chain = foundry,
): Promise<EndToEndContext> {
Expand Down
Loading