-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Remove all intermediary ChainEvents #4973
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
40b0630
to
caa0d3a
Compare
commit 40b0630 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed Jan 4 20:50:58 2023 +0800 Update tests commit a6df872 Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed Jan 4 12:55:07 2023 +0800 Make enum const commit c13f17c Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed Jan 4 12:40:17 2023 +0800 Remove middleware ChainEvents commit 41d11aa Author: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed Jan 4 11:28:10 2023 +0800 Remove intermediary event ChainEvent.forkChoiceReorg
caa0d3a
to
1bbe1ec
Compare
@@ -350,3 +349,26 @@ describe("executionEngine / ExecutionEngineHttp", function () { | |||
console.log("\n\nDone\n\n"); | |||
} | |||
}); | |||
|
|||
async function retrieveCanonicalWithdrawals(bn: BeaconNode, fromSlot: Slot, toSlot: Slot): Promise<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.
@g11tech Can you review if this assertion is good for your test? Re-wrote the previous event based, into an after the fact one
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.
yes looks good
@@ -217,6 +219,9 @@ describe("executionEngine / ExecutionEngineHttp", function () { | |||
// delay a bit so regular sync sees it's up to date and sync is completed from the beginning | |||
const genesisSlotsDelay = 8; | |||
|
|||
// TODO for g11tech: Why 4? Provide rationale for the 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.
@g11tech: Why 4? Provide rationale for the 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.
from the test length run i noted that if there is no issue, withdrawal blocks come out to be 6, so i chose 4 as safe number incase there are any skipped slots for whatever reasons (sometimes have seen it happening)
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.
lgtm!
@@ -5,7 +5,7 @@ import {RouteDef, TypeJson} from "../../utils/index.js"; | |||
|
|||
// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes | |||
|
|||
export enum EventType { | |||
export const enum EventType { |
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.
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.
IMO this should be reinstated as an enum
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.
Also re-exported as necessary to allow for downstream reuse
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.
changed in #5042, seems to be re-exported already so we should be fine there
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.
Potentially unwanted side-effect from attempting to make EventType from API + ChainEvent work for the same handlers. Happy to revert it to enum
Motivation
BeaconNode source emits events meant for the API through intermediary ChainEvents. That's not necessary since the few users of the internal events can just listen to the events defined as in the API.
Description
Remove all intermediary ChainEvents