Skip to content

Commit

Permalink
Update sim test
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Dec 22, 2023
1 parent da84a19 commit ad50d55
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/beacon-node/test/sim/6110-interop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ describe("executionEngine / ExecutionEngineHttp", function () {
`Unfinalized cache is missing the expected validator. Size: ${epochCtx.unfinalizedPubkey2index.size}`
);
}
// epochCtx.historicalValidatorsLength should be empty since no epoch transition has happened.
if (!epochCtx.historicalValidatorLengths.isEmpty()) {
throw Error("Historical validator lengths is modified");
}

await new Promise<void>((resolve, _reject) => {
bn.chain.clock.on(ClockEvent.epoch, (epoch) => {
Expand Down Expand Up @@ -407,6 +411,12 @@ describe("executionEngine / ExecutionEngineHttp", function () {
if (!epochCtx.unfinalizedPubkey2index.isEmpty()) {
throw Error("Unfinalized cache still contains new validator");
}
// After 4 epochs, headState's finalized cp epoch should be 2
// Its historicalValidatorLengths should store lengths for epoch 3 and 4 hence size should be 2
console.log(`haha ${epochCtx.historicalValidatorLengths.size}`);
if (epochCtx.historicalValidatorLengths.size !== 2) {
throw Error("Historical validator lengths is not updated correctly")
}

if (headState.depositReceiptsStartIndex === UNSET_DEPOSIT_RECEIPTS_START_INDEX) {
throw Error("state.depositReceiptsStartIndex is not set upon processing new deposit receipt");
Expand Down

0 comments on commit ad50d55

Please sign in to comment.