-
Notifications
You must be signed in to change notification settings - Fork 233
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: slot duration flexibility #8122
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @LHerskind and the rest of your teammates on Graphite |
e55098b
to
2cb5eea
Compare
Benchmark resultsMetrics with a significant change:
Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Proof generationEach column represents the number of threads used in proof generation.
L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 8 txs.
Circuits statsStats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.
Stats on running time collected for app circuits
AVM SimulationTime to simulate various public functions in the AVM.
Public DB AccessTime to access various public DBs.
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method | Metric | | |
b68ce98
to
8dd3961
Compare
@spalladino I recall you mentioned at some point to let you know if new flags etc 👀 I have a new flag here, it is effective if we are using |
8dd3961
to
eb16d6e
Compare
@@ -132,8 +132,10 @@ global INITIALIZATION_SLOT_SEPARATOR: Field = 1000_000_000; | |||
global INITIAL_L2_BLOCK_NUM: Field = 1; | |||
global BLOB_SIZE_IN_BYTES: Field = 31 * 4096; | |||
global ETHEREUM_SLOT_DURATION: u32 = 12; | |||
global AZTEC_SLOT_DURATION: u32 = ETHEREUM_SLOT_DURATION * 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the need for the * 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want the AZTEC_SLOT_DURATION
to be a multiple of a ETHEREUM_SLOT_DURATION
so just makes it very easy to change it to 3 to have the different duration 🤷 Is not really needed when the value is 1, but just kinda nice to showcase multiple I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall great work, I'm not the biggest fan of the wrap logic living within the node itself, but it seems to be a necessary evil
l1-contracts/src/core/Rollup.sol
Outdated
@@ -88,7 +88,11 @@ contract Rollup is Leonidas, IRollup, ITestRollup { | |||
VERSION = 1; | |||
|
|||
// Genesis block | |||
blocks[0] = BlockLog({archive: bytes32(0), slotNumber: 0, isProven: true}); | |||
blocks[0] = BlockLog({ | |||
archive: bytes32(0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this calcualted from ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the lastArchive
that all tests will spit out for block 1, e.g., what initial state of the trees.
@@ -77,6 +77,9 @@ const config = getConfigEnvVars(); | |||
|
|||
const numberOfConsecutiveBlocks = 2; | |||
|
|||
// The initial archive is what we have in the genesis block in `Rollup.sol`. | |||
const INITIAL_ARCHIVE = Fr.fromString('0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e').toBuffer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this make sense to go in the constants if it will be hardcoded as such
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ye probably a fine idea.
@@ -169,6 +172,7 @@ describe('L1Publisher integration', () => { | |||
publisherPrivateKey: sequencerPK, | |||
l1PublishRetryIntervalMS: 100, | |||
l1ChainId: 31337, | |||
timeTraveler: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we add an issue to remove this at some point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #8153.
@@ -270,14 +301,55 @@ export class L1Publisher { | |||
return false; | |||
} | |||
|
|||
async commitTimeJump(slot: bigint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it enough just to have test utilities to calaulcate / do this, rather than embed this inside the publisher itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it needs to go in here to make the other tests pass within IS_DEV_NET
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason it was in the publisher itself was that it was something we needed to do when a block was published (or for the simulation issue), so keeping it there gave better control.
Alternatively could be running in the background in the tests to progress blocks if nothing have happened for 12 seconds essentially making a fallback to the interval mining, which would be slower unless it also look into jumping the required time for slots etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried it out. Works fine for handling the "slot already filled", but non-obvious how to check for the simulation failure without rebuilding a lot of the sequencer, so just had a "progress block at least every 12 seconds". It will kinda work, but it is really slow if it start running into the "have to wait" case.
const result = await publisher.processL2Block(l2Block); | ||
|
||
expect(result).toEqual(false); | ||
expect(rollupContractWrite.process).toHaveBeenCalledTimes(1); | ||
}); | ||
|
||
it('does not retry if simulating a publish and process tx fails', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
client: walletClient, | ||
}); | ||
|
||
// @note We make a time jump PAST the very first slot to not have to deal with the edge case of the first slot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain why the first slot is such an edge case, not necessarily in the code, but to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The genesis block is at slot 0, so the slot is already occupied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That feels like a worthy comment in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: necessarily in the code
@@ -47,7 +48,13 @@ describe('e2e_p2p_network', () => { | |||
let deployL1ContractsValues: DeployL1Contracts; | |||
|
|||
beforeEach(async () => { | |||
({ teardown, config, logger, deployL1ContractsValues } = await setup(0)); | |||
// If we want to test with interval mining, we can use the local host and start `anvil --block-time 12` | |||
const useLocalHost = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could have the interval mining settings added to the createAnvilOpts instead? So it is not as siloed to this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was not always for interval, sometimes also just used it to get proper errors back. For cases like the e2e_token_contract
I think it might cause quite a bit of pain if they are all using the same local anvil for example (unless interval mining ye). The case is only really interesting for testing the sequencing which is currently only happening in this test.
@trackSpan('Sequencer.buildBlockAndPublish', (_validTxs, newGlobalVariables, _historicalHeader) => ({ | ||
[Attributes.BLOCK_NUMBER]: newGlobalVariables.blockNumber.toNumber(), | ||
})) | ||
async canProposeBlock( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice function
return true; | ||
} | ||
|
||
async assertCanStillProposeBlock(): Promise<void> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bollocks.
eb16d6e
to
a4fd588
Compare
@@ -128,7 +125,7 @@ contract SpartaTest is DecoderBase { | |||
return; | |||
} | |||
|
|||
_testBlock("mixed_block_1", false, 0, false); // We run a block before the epoch with validators | |||
_testBlock("mixed_block_1", false, 3, false); // We run a block before the epoch with validators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead comment
@@ -463,13 +469,13 @@ describe('L1Publisher integration', () => { | |||
nextL1ToL2Messages = []; | |||
|
|||
// @todo @LHerskind need to make sure that time have progressed to the next slot! | |||
await setTimeToNextSlot(); | |||
await progressTimeBySlot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just to help the next test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its running a loop and publishing to the contract so if the contract it unhappy it would make the test fail. The underlying chain just have to be progressed, when the block time are equal for the two there are no issues, but it gets weird when they differ without this one.
client: walletClient, | ||
}); | ||
|
||
// @note We make a time jump PAST the very first slot to not have to deal with the edge case of the first slot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That feels like a worthy comment in the code
const submitter = await this.getProposerAtNextEthBlock(); | ||
const sender = await this.getSenderAddress(); | ||
return submitter.isZero() || submitter.equals(sender); | ||
// @note Assumes that all ethereum slots have blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create an issue to test the case where L1 has empty slots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if anvil allow you to do this. The issue that might be encountered if this is the very last check before publishing could be that you are publishing a tx that will end up reverting. Would happen if the last slot you could include your tx in is also the one that is skipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think we'd just need to kill anvil for a period of time and then restore it.
} | ||
|
||
// If the aztec slot duration is same length as the ethereum slot duration, we don't need to do anything | ||
if ((ETHEREUM_SLOT_DURATION as number) === (AZTEC_SLOT_DURATION as number)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't this help us when they are the same?
For example, suppose L1 is at t=13 seconds after genesis.
We just published the block in slot 1.
Would we not want to jump L1 to t=24?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, the next block will already be at 24, you don't need to jump to it. Also, I believe you mean t=13 for the first?
return submitter.isZero() || submitter.equals(sender); | ||
// @note Assumes that all ethereum slots have blocks | ||
// Using next Ethereum block so we do NOT need to wait for it being mined before seeing the effect | ||
public async getMetadataForSlotAtNextEthBlock(): Promise<[EthAddress, bigint, bigint, Buffer]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally dislike returning tuples like this especially when there are repeated types (bigint, bigint
).
For example, it took me a minute to understand you're returning the pendingBlockNumber
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can change it to a struct.
throw new Error(msg); | ||
} | ||
|
||
const currentBlockNumber = await this.l2BlockSource.getBlockNumber(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How could this happen if we have ensured that L1 is expecting this block number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const msg = 'New block was emitted while building block';
If anyone else published a block.
|
||
if (IS_DEV_NET) { | ||
// Compute time elapsed since the previous block | ||
const lastBlockTime = historicalHeader?.globalVariables.timestamp.toNumber() || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like duplication of skipMinTxsPerBlockCheck
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different variables. minSecondsBetweenBlocks != maxSecondsBetweenBlocks
.
let attestations: BlockAttestation[] = []; | ||
this.log.info(`Waiting for ${numberOfRequiredAttestations} attestations for slot: ${slot}`); | ||
|
||
let attestations: BlockAttestation[] = [await this.attestToProposal(proposal)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always attest to my own proposal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The smart contract does not filter the proposer from the expected signatures, this could probably be removed by doing the filtering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He is a member of the committee, so he can attest 🤷 Pretty sure the same is the case for other systems as well. If you are running small committees it is also a requirement to really hit the quorum needed.
@LHerskind thanks for the heads up. Not sure I followed though: the new flag is the |
In here it is Currently, we are taking a look to see if we can rip it out, such that you don't have to deal with it at all. |
a4fd588
to
f056f6b
Compare
f056f6b
to
10d2ad6
Compare
Following #8193 I'm not really sure around the setup that you are using for the devnet/provernet, since I would expect you to be running it with the same block times as Eth but the issues encountered there seems to be mainly related to timing of the underlying not matching what was expected. If the |
10d2ad6
to
6123a76
Compare
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-package: 0.51.1</summary> ## [0.51.1](aztec-package-v0.51.0...aztec-package-v0.51.1) (2024-08-29) ### Features * Add status check to prover agent ([#8248](#8248)) ([7b3006a](7b3006a)) * Faster L1 deployment ([#8234](#8234)) ([51d6699](51d6699)) * Spartan token transfer ([#8163](#8163)) ([38f0157](38f0157)) </details> <details><summary>barretenberg.js: 0.51.1</summary> ## [0.51.1](barretenberg.js-v0.51.0...barretenberg.js-v0.51.1) (2024-08-29) ### Miscellaneous * **barretenberg.js:** Synchronize aztec-packages versions </details> <details><summary>aztec-packages: 0.51.1</summary> ## [0.51.1](aztec-packages-v0.51.0...aztec-packages-v0.51.1) (2024-08-29) ### Features * Add CLI command for gathering proving metrics ([#8221](#8221)) ([5929a42](5929a42)) * Add status check to prover agent ([#8248](#8248)) ([7b3006a](7b3006a)) * **avm:** 1-slot sload/sstore (nr, ts) ([#8264](#8264)) ([bdd9b06](bdd9b06)) * **avm:** Range check gadget ([#7967](#7967)) ([0dd954e](0dd954e)) * **docs:** Add partial notes doc ([#8192](#8192)) ([4299bbd](4299bbd)) * Faster L1 deployment ([#8234](#8234)) ([51d6699](51d6699)) * Initial validator set ([#8133](#8133)) ([6d31ad2](6d31ad2)) * L1-publisher cleanup ([#8148](#8148)) ([6ae2535](6ae2535)) * Proof surgery class ([#8236](#8236)) ([10d7edd](10d7edd)) * Request specific transactions through the p2p layer ([#8185](#8185)) ([54e1cc7](54e1cc7)) * Slot duration flexibility ([#8122](#8122)) ([708e4e5](708e4e5)) * Spartan token transfer ([#8163](#8163)) ([38f0157](38f0157)) ### Bug Fixes * Attempt to fix nightly test ([#8222](#8222)) ([477eec5](477eec5)) * **avm-simulator:** Await avm bytecode check ([#8268](#8268)) ([4410eb3](4410eb3)) * **bb-prover:** Create structure for AVM vk ([#8233](#8233)) ([55b6ba2](55b6ba2)) * **bb:** Mac build ([#8255](#8255)) ([ac54f5c](ac54f5c)) * **ci:** Spot-runner-action was not built ([#8274](#8274)) ([c1509c1](c1509c1)) * **ci:** Try fix brotli edge-case ([#8256](#8256)) ([e03ea0b](e03ea0b)) * Docker containers healthchecks ([#8228](#8228)) ([19edbbb](19edbbb)) * **docs:** Update entrypoint details on accounts page ([#8184](#8184)) ([8453ec7](8453ec7)) * Export brillig names in contract functions ([#8212](#8212)) ([4745741](4745741)) * Fixes for the nightly test run against Sepolia ([#8229](#8229)) ([cfc65c6](cfc65c6)) * Handle constant output for sha256 ([#8251](#8251)) ([0653ba5](0653ba5)) * Log public vm errors as warn in prover-agent ([#8247](#8247)) ([9f4ea9f](9f4ea9f)) * Remove devnet ARM builds for now ([#8202](#8202)) ([81ef715](81ef715)) * Remove fundFpc step from bootstrap ([#8245](#8245)) ([a742531](a742531)) * Ts codegen ([#8267](#8267)) ([cb58800](cb58800)) ### Miscellaneous * Add check to just release images to devnet-deploys ([#8242](#8242)) ([aa6791d](aa6791d)) * Add partial note support for value note ([#8141](#8141)) ([daa57cc](daa57cc)) * Always run `build-check` step in `publish-bb.yml` ([#8240](#8240)) ([5e9749f](5e9749f)) * **avm:** Replace range and cmp with gadgets ([#8164](#8164)) ([cc12558](cc12558)) * Basic network matrix ([#8257](#8257)) ([2a76b1a](2a76b1a)), closes [#8001](#8001) * **bb:** Use std::span in pippenger for scalars ([#8269](#8269)) ([2323cd5](2323cd5)) * Configure interval mining for anvil ([#8211](#8211)) ([eba57b4](eba57b4)) * Create external-ci-approved.yml ([#8235](#8235)) ([24b059b](24b059b)) * Disallow prune in devnet + add onlyOwners ([#8134](#8134)) ([c736f96](c736f96)) * Fix various warnings in noir code ([#8258](#8258)) ([1c6b478](1c6b478)) * Less noisy AVM failures in proving ([#8227](#8227)) ([03bcd62](03bcd62)) * Open an issue if publishing bb fails ([#8223](#8223)) ([2d7a775](2d7a775)) * Reinstate l1-contracts package ([#8250](#8250)) ([263a912](263a912)) * Remove unused generic parameters ([#8249](#8249)) ([00ed045](00ed045)) * Replace relative paths to noir-protocol-circuits ([1783c80](1783c80)) * Replace relative paths to noir-protocol-circuits ([ffe1f35](ffe1f35)) * Report prover metrics ([#8155](#8155)) ([dc7bcdf](dc7bcdf)), closes [#7675](#7675) * Rework balances map ([#8127](#8127)) ([1cac3dd](1cac3dd)), closes [#8104](#8104) * Run CI after merges to provernet ([#8244](#8244)) ([97e5e25](97e5e25)) ### Documentation * Minor fixes ([#8273](#8273)) ([2b8af9e](2b8af9e)) </details> <details><summary>barretenberg: 0.51.1</summary> ## [0.51.1](barretenberg-v0.51.0...barretenberg-v0.51.1) (2024-08-29) ### Features * **avm:** 1-slot sload/sstore (nr, ts) ([#8264](#8264)) ([bdd9b06](bdd9b06)) * **avm:** Range check gadget ([#7967](#7967)) ([0dd954e](0dd954e)) * Proof surgery class ([#8236](#8236)) ([10d7edd](10d7edd)) ### Bug Fixes * **bb-prover:** Create structure for AVM vk ([#8233](#8233)) ([55b6ba2](55b6ba2)) * **bb:** Mac build ([#8255](#8255)) ([ac54f5c](ac54f5c)) * Handle constant output for sha256 ([#8251](#8251)) ([0653ba5](0653ba5)) ### Miscellaneous * **avm:** Replace range and cmp with gadgets ([#8164](#8164)) ([cc12558](cc12558)) * **bb:** Use std::span in pippenger for scalars ([#8269](#8269)) ([2323cd5](2323cd5)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-package: 0.51.1</summary> ## [0.51.1](AztecProtocol/aztec-packages@aztec-package-v0.51.0...aztec-package-v0.51.1) (2024-08-29) ### Features * Add status check to prover agent ([#8248](AztecProtocol/aztec-packages#8248)) ([7b3006a](AztecProtocol/aztec-packages@7b3006a)) * Faster L1 deployment ([#8234](AztecProtocol/aztec-packages#8234)) ([51d6699](AztecProtocol/aztec-packages@51d6699)) * Spartan token transfer ([#8163](AztecProtocol/aztec-packages#8163)) ([38f0157](AztecProtocol/aztec-packages@38f0157)) </details> <details><summary>barretenberg.js: 0.51.1</summary> ## [0.51.1](AztecProtocol/aztec-packages@barretenberg.js-v0.51.0...barretenberg.js-v0.51.1) (2024-08-29) ### Miscellaneous * **barretenberg.js:** Synchronize aztec-packages versions </details> <details><summary>aztec-packages: 0.51.1</summary> ## [0.51.1](AztecProtocol/aztec-packages@aztec-packages-v0.51.0...aztec-packages-v0.51.1) (2024-08-29) ### Features * Add CLI command for gathering proving metrics ([#8221](AztecProtocol/aztec-packages#8221)) ([5929a42](AztecProtocol/aztec-packages@5929a42)) * Add status check to prover agent ([#8248](AztecProtocol/aztec-packages#8248)) ([7b3006a](AztecProtocol/aztec-packages@7b3006a)) * **avm:** 1-slot sload/sstore (nr, ts) ([#8264](AztecProtocol/aztec-packages#8264)) ([bdd9b06](AztecProtocol/aztec-packages@bdd9b06)) * **avm:** Range check gadget ([#7967](AztecProtocol/aztec-packages#7967)) ([0dd954e](AztecProtocol/aztec-packages@0dd954e)) * **docs:** Add partial notes doc ([#8192](AztecProtocol/aztec-packages#8192)) ([4299bbd](AztecProtocol/aztec-packages@4299bbd)) * Faster L1 deployment ([#8234](AztecProtocol/aztec-packages#8234)) ([51d6699](AztecProtocol/aztec-packages@51d6699)) * Initial validator set ([#8133](AztecProtocol/aztec-packages#8133)) ([6d31ad2](AztecProtocol/aztec-packages@6d31ad2)) * L1-publisher cleanup ([#8148](AztecProtocol/aztec-packages#8148)) ([6ae2535](AztecProtocol/aztec-packages@6ae2535)) * Proof surgery class ([#8236](AztecProtocol/aztec-packages#8236)) ([10d7edd](AztecProtocol/aztec-packages@10d7edd)) * Request specific transactions through the p2p layer ([#8185](AztecProtocol/aztec-packages#8185)) ([54e1cc7](AztecProtocol/aztec-packages@54e1cc7)) * Slot duration flexibility ([#8122](AztecProtocol/aztec-packages#8122)) ([708e4e5](AztecProtocol/aztec-packages@708e4e5)) * Spartan token transfer ([#8163](AztecProtocol/aztec-packages#8163)) ([38f0157](AztecProtocol/aztec-packages@38f0157)) ### Bug Fixes * Attempt to fix nightly test ([#8222](AztecProtocol/aztec-packages#8222)) ([477eec5](AztecProtocol/aztec-packages@477eec5)) * **avm-simulator:** Await avm bytecode check ([#8268](AztecProtocol/aztec-packages#8268)) ([4410eb3](AztecProtocol/aztec-packages@4410eb3)) * **bb-prover:** Create structure for AVM vk ([#8233](AztecProtocol/aztec-packages#8233)) ([55b6ba2](AztecProtocol/aztec-packages@55b6ba2)) * **bb:** Mac build ([#8255](AztecProtocol/aztec-packages#8255)) ([ac54f5c](AztecProtocol/aztec-packages@ac54f5c)) * **ci:** Spot-runner-action was not built ([#8274](AztecProtocol/aztec-packages#8274)) ([c1509c1](AztecProtocol/aztec-packages@c1509c1)) * **ci:** Try fix brotli edge-case ([#8256](AztecProtocol/aztec-packages#8256)) ([e03ea0b](AztecProtocol/aztec-packages@e03ea0b)) * Docker containers healthchecks ([#8228](AztecProtocol/aztec-packages#8228)) ([19edbbb](AztecProtocol/aztec-packages@19edbbb)) * **docs:** Update entrypoint details on accounts page ([#8184](AztecProtocol/aztec-packages#8184)) ([8453ec7](AztecProtocol/aztec-packages@8453ec7)) * Export brillig names in contract functions ([#8212](AztecProtocol/aztec-packages#8212)) ([4745741](AztecProtocol/aztec-packages@4745741)) * Fixes for the nightly test run against Sepolia ([#8229](AztecProtocol/aztec-packages#8229)) ([cfc65c6](AztecProtocol/aztec-packages@cfc65c6)) * Handle constant output for sha256 ([#8251](AztecProtocol/aztec-packages#8251)) ([0653ba5](AztecProtocol/aztec-packages@0653ba5)) * Log public vm errors as warn in prover-agent ([#8247](AztecProtocol/aztec-packages#8247)) ([9f4ea9f](AztecProtocol/aztec-packages@9f4ea9f)) * Remove devnet ARM builds for now ([#8202](AztecProtocol/aztec-packages#8202)) ([81ef715](AztecProtocol/aztec-packages@81ef715)) * Remove fundFpc step from bootstrap ([#8245](AztecProtocol/aztec-packages#8245)) ([a742531](AztecProtocol/aztec-packages@a742531)) * Ts codegen ([#8267](AztecProtocol/aztec-packages#8267)) ([cb58800](AztecProtocol/aztec-packages@cb58800)) ### Miscellaneous * Add check to just release images to devnet-deploys ([#8242](AztecProtocol/aztec-packages#8242)) ([aa6791d](AztecProtocol/aztec-packages@aa6791d)) * Add partial note support for value note ([#8141](AztecProtocol/aztec-packages#8141)) ([daa57cc](AztecProtocol/aztec-packages@daa57cc)) * Always run `build-check` step in `publish-bb.yml` ([#8240](AztecProtocol/aztec-packages#8240)) ([5e9749f](AztecProtocol/aztec-packages@5e9749f)) * **avm:** Replace range and cmp with gadgets ([#8164](AztecProtocol/aztec-packages#8164)) ([cc12558](AztecProtocol/aztec-packages@cc12558)) * Basic network matrix ([#8257](AztecProtocol/aztec-packages#8257)) ([2a76b1a](AztecProtocol/aztec-packages@2a76b1a)), closes [#8001](AztecProtocol/aztec-packages#8001) * **bb:** Use std::span in pippenger for scalars ([#8269](AztecProtocol/aztec-packages#8269)) ([2323cd5](AztecProtocol/aztec-packages@2323cd5)) * Configure interval mining for anvil ([#8211](AztecProtocol/aztec-packages#8211)) ([eba57b4](AztecProtocol/aztec-packages@eba57b4)) * Create external-ci-approved.yml ([#8235](AztecProtocol/aztec-packages#8235)) ([24b059b](AztecProtocol/aztec-packages@24b059b)) * Disallow prune in devnet + add onlyOwners ([#8134](AztecProtocol/aztec-packages#8134)) ([c736f96](AztecProtocol/aztec-packages@c736f96)) * Fix various warnings in noir code ([#8258](AztecProtocol/aztec-packages#8258)) ([1c6b478](AztecProtocol/aztec-packages@1c6b478)) * Less noisy AVM failures in proving ([#8227](AztecProtocol/aztec-packages#8227)) ([03bcd62](AztecProtocol/aztec-packages@03bcd62)) * Open an issue if publishing bb fails ([#8223](AztecProtocol/aztec-packages#8223)) ([2d7a775](AztecProtocol/aztec-packages@2d7a775)) * Reinstate l1-contracts package ([#8250](AztecProtocol/aztec-packages#8250)) ([263a912](AztecProtocol/aztec-packages@263a912)) * Remove unused generic parameters ([#8249](AztecProtocol/aztec-packages#8249)) ([00ed045](AztecProtocol/aztec-packages@00ed045)) * Replace relative paths to noir-protocol-circuits ([1783c80](AztecProtocol/aztec-packages@1783c80)) * Replace relative paths to noir-protocol-circuits ([ffe1f35](AztecProtocol/aztec-packages@ffe1f35)) * Report prover metrics ([#8155](AztecProtocol/aztec-packages#8155)) ([dc7bcdf](AztecProtocol/aztec-packages@dc7bcdf)), closes [#7675](AztecProtocol/aztec-packages#7675) * Rework balances map ([#8127](AztecProtocol/aztec-packages#8127)) ([1cac3dd](AztecProtocol/aztec-packages@1cac3dd)), closes [#8104](AztecProtocol/aztec-packages#8104) * Run CI after merges to provernet ([#8244](AztecProtocol/aztec-packages#8244)) ([97e5e25](AztecProtocol/aztec-packages@97e5e25)) ### Documentation * Minor fixes ([#8273](AztecProtocol/aztec-packages#8273)) ([2b8af9e](AztecProtocol/aztec-packages@2b8af9e)) </details> <details><summary>barretenberg: 0.51.1</summary> ## [0.51.1](AztecProtocol/aztec-packages@barretenberg-v0.51.0...barretenberg-v0.51.1) (2024-08-29) ### Features * **avm:** 1-slot sload/sstore (nr, ts) ([#8264](AztecProtocol/aztec-packages#8264)) ([bdd9b06](AztecProtocol/aztec-packages@bdd9b06)) * **avm:** Range check gadget ([#7967](AztecProtocol/aztec-packages#7967)) ([0dd954e](AztecProtocol/aztec-packages@0dd954e)) * Proof surgery class ([#8236](AztecProtocol/aztec-packages#8236)) ([10d7edd](AztecProtocol/aztec-packages@10d7edd)) ### Bug Fixes * **bb-prover:** Create structure for AVM vk ([#8233](AztecProtocol/aztec-packages#8233)) ([55b6ba2](AztecProtocol/aztec-packages@55b6ba2)) * **bb:** Mac build ([#8255](AztecProtocol/aztec-packages#8255)) ([ac54f5c](AztecProtocol/aztec-packages@ac54f5c)) * Handle constant output for sha256 ([#8251](AztecProtocol/aztec-packages#8251)) ([0653ba5](AztecProtocol/aztec-packages@0653ba5)) ### Miscellaneous * **avm:** Replace range and cmp with gadgets ([#8164](AztecProtocol/aztec-packages#8164)) ([cc12558](AztecProtocol/aztec-packages@cc12558)) * **bb:** Use std::span in pippenger for scalars ([#8269](AztecProtocol/aztec-packages#8269)) ([2323cd5](AztecProtocol/aztec-packages@2323cd5)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This PR add support for using Aztec slot durations that are not just 1 ethereum slot.
To do so it adds more logic to the sequencer such that they can figure out if they are really the sequencer or not.
This is mainly in the
canProposeBlock
andshouldProposeBlock
functions which respectively assert that the proposer can actually propose, and whether he should. The logic in those functions are partly what we had sprinkled over the code before, but also adding some additional checks to match what is in the rollup contract and Leonidas.Since there are now additional restrictions to block production related to WHEN the block is to land on L1, I have added a
commitTimeJump
function into thel1-publisher
which will jump to the next slot after a block have been published. This functionality toggled with aTIME_TRAVELER
boolean flag.Note that we will jump INTO the next slot, since simulations in
viem
andanvil
are limited to run on block values in the bast, meaning that we cannot nicely just simulate as if it was included in the NEXT block which is what we ideally want. See issue #8110 for more information.Since it caused some issues that there was no actual genesis state (just 0), I have inserted a genesis state equal to what we compute as the
lastArchive
for the very first block, fixing #4148.To not mess too much with DEVNET, the extra logic related to the exact timing of when L2 blocks should make it onto L1 can be "toggled" with the
IS_DEV_NET
flag.Namely, if
IS_DEV_NET
is toggled, we can publish outside of the "current" slot, as long as the slots are in order. With the changes in this pr, we should be able to run DEVNET withoutautomine
, I have tried a minor test but that seemed to work fine when we haveAZTEC_SLOT_DURATION = 36
and internal mining :)Points of interest:
sequencer.ts
canProposeBlock
shouldProposeBlock
l1-publisher.ts
simulate
since viemwrite
does not provide meaningful error messages, butsimulate
does.commitTimeJump
won't happen if theAZTEC_SLOT_DURATION = ETHEREUM_SLOT_DURATION
orTIME_TRAVELER = false
sequencer.test.ts
builds a block that contains zero real transactions once flushed
sounds to me like you expect to have an empty block, after the block flushed, e.g., once flushed make it sound like it already happenedl1-publisher.test.ts
does not publish if last archive root is different to expected
is deleted, as that job falls on the sequencer. The sequencer should define whether or not it will send a tx, and publisher deals more with publishing tasks.simulate
that is also mocked to account forsimulate
in the publisher.e2e_p2p_network.test.ts
This PR will be run with
AZTEC_SLOT_DURATION = 12
andIS_DEV_NET = true
. Note that when using values different from those, there are still some hiccups and kinks, but it should be addressed in a separate PR to not make this explode in size.