-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
fix: ignore already known errors in API #6321
Conversation
e instanceof SyncCommitteeError && | ||
e.type.code === SyncCommitteeErrorCode.SYNC_COMMITTEE_AGGREGATOR_ALREADY_KNOWN | ||
) { | ||
logger.debug("Ignoring known contributionAndProof", logCtx); |
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.
This error was already ignored previously (added in #2598) but it got removed again by #2816 as the PR changed the error behavior.
In #4019 it was introduced again that the error is thrown during validation but the handling on the API was not re-added.
The error was recently observed (#6021 (comment)) and should be ignored again.
@@ -224,7 +234,7 @@ export function getBeaconPoolApi({ | |||
); | |||
|
|||
if (errors.length > 1) { | |||
throw Error("Multiple errors on publishAggregateAndProofs\n" + errors.map((e) => e.message).join("\n")); | |||
throw Error("Multiple errors on submitPoolSyncCommitteeSignatures\n" + errors.map((e) => e.message).join("\n")); |
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.
This just fixes a typo but it is worth highlighting that we don't need to handle already known errors in submitPoolSyncCommitteeSignatures as the api only verifies the signature
lodestar/packages/beacon-node/src/api/impl/beacon/pool/index.ts
Lines 184 to 186 in d7ca290
// Verify signature only, all other data is very likely to be correct, since the `signature` object is created by this node. | |
// Worst case if `signature` is not valid, gossip peers will drop it and slightly downscore us. | |
await validateApiSyncCommittee(chain, state, signature); |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #6321 +/- ##
=========================================
Coverage 76.52% 76.53%
=========================================
Files 248 248
Lines 25935 25943 +8
Branches 1449 1449
=========================================
+ Hits 19847 19855 +8
Misses 6058 6058
Partials 30 30 |
Performance Report✔️ no performance regression detected Full benchmark results
|
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 have tested this PR by running multiple Lodestar nodes and configured Teku VC to publish to all of them. The error can be easily reproduced by adding an artifical delay to the api as attestations will frequently reach the node by gossip before the api.
* Ignore known attestations submitted through API * Ignore known sync committee aggregate * Add log contex to ignored aggregate attestations * Fix typo in submitPoolSyncCommitteeSignatures
🎉 This PR is included in v1.15.0 🎉 |
Motivation
Attestations might already be published by another node as part of a fallback setup or DVT cluster
and can reach our node by gossip before the api. The error can be ignored and should not result in a 500 response.
There are also other errors related to that like known aggregates which should be ignored as well (see previous PR #2598)
Description
Ignore already known (
_ALREADY_KNOWN
) errors in API and return 200 response.Closes #6021