Skip to content

Commit b035d01

Browse files
authored
fix: remove special case for epoch 0 (#8549)
1 parent 5a6aaeb commit b035d01

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

l1-contracts/src/core/Rollup.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ contract Rollup is Leonidas, IRollup, ITestRollup {
170170

171171
function computeTxsEffectsHash(bytes calldata _body)
172172
external
173-
view
173+
pure
174174
override(IRollup)
175175
returns (bytes32)
176176
{

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ interface IRollup {
6666

6767
function archive() external view returns (bytes32);
6868
function archiveAt(uint256 _blockNumber) external view returns (bytes32);
69-
function computeTxsEffectsHash(bytes calldata _body) external view returns (bytes32);
69+
function computeTxsEffectsHash(bytes calldata _body) external pure returns (bytes32);
7070
}

l1-contracts/src/core/sequencer_selection/Leonidas.sol

-3
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ contract Leonidas is Ownable, ILeonidas {
289289
function getProposerAt(uint256 _ts) public view override(ILeonidas) returns (address) {
290290
uint256 epochNumber = getEpochAt(_ts);
291291
uint256 slot = getSlotAt(_ts);
292-
if (epochNumber == 0) {
293-
return address(0);
294-
}
295292

296293
Epoch storage epoch = epochs[epochNumber];
297294

l1-contracts/test/sparta/Sparta.t.sol

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ contract SpartaTest is DecoderBase {
9797
assertFalse(_seenCommittee[committee[i]]);
9898
_seenCommittee[committee[i]] = true;
9999
}
100+
101+
address proposer = rollup.getCurrentProposer();
102+
assertTrue(_seenCommittee[proposer]);
100103
}
101104

102105
function testProposerForNonSetupEpoch(uint8 _epochsToJump) public setup(4) {

yarn-project/end-to-end/src/fixtures/utils.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ export async function setup(
383383
config.publisherPrivateKey = `0x${publisherPrivKey!.toString('hex')}`;
384384
}
385385

386+
// Made as separate values such that keys can change, but for test they will be the same.
387+
config.validatorPrivateKey = config.publisherPrivateKey;
388+
386389
if (PXE_URL) {
387390
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
388391
return await setupWithRemoteEnvironment(publisherHdAccount!, config, logger, numberOfAccounts, enableGas);
@@ -408,10 +411,6 @@ export async function setup(
408411

409412
await watcher.start();
410413

411-
// Run the test with validators enabled
412-
const validatorPrivKey = getPrivateKeyFromIndex(1);
413-
config.validatorPrivateKey = `0x${validatorPrivKey!.toString('hex')}`;
414-
415414
logger.verbose('Creating and synching an aztec node...');
416415

417416
const acvmConfig = await getACVMConfig(logger);

yarn-project/sequencer-client/src/publisher/l1-publisher.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,12 @@ export class L1Publisher {
405405
}),
406406
});
407407

408-
const min = (a: bigint, b: bigint) => (a > b ? b : a);
409-
410408
// @note We perform this guesstimate instead of the usual `gasEstimate` since
411409
// viem will use the current state to simulate against, which means that
412410
// we will fail estimation in the case where we are simulating for the
413411
// first ethereum block within our slot (as current time is not in the
414412
// slot yet).
415-
const gasGuesstimate = min(computeTxsEffectsHashGas + L1Publisher.PROPOSE_GAS_GUESS, 15_000_000n);
413+
const gasGuesstimate = computeTxsEffectsHashGas + L1Publisher.PROPOSE_GAS_GUESS;
416414

417415
const attestations = encodedData.attestations
418416
? encodedData.attestations.map(attest => attest.toViemSignature())

0 commit comments

Comments
 (0)