-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core/bcast: make lighthouse submit attestations idempotent (#813)
Catch and ignore lighthouse non-idempotent error. This follows the example set inside goeth2client (but only used for failover in multi-client setup). category: bug ticket: #777
- Loading branch information
1 parent
fc44c85
commit cdbf821
Showing
2 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ package bcast | |
|
||
import ( | ||
"context" | ||
"strings" | ||
"time" | ||
|
||
eth2client "github.com/attestantio/go-eth2-client" | ||
|
@@ -81,6 +82,11 @@ func (b Broadcaster) Broadcast(ctx context.Context, duty core.Duty, | |
} | ||
|
||
err = b.eth2Cl.SubmitAttestations(ctx, []*eth2p0.Attestation{&att.Attestation}) | ||
if err != nil && strings.Contains(err.Error(), "PriorAttestationKnown") { | ||
// Lighthouse isn't idempotent, so just swallow this non-issue. | ||
// See reference github.com/attestantio/[email protected]/multi/submitattestations.go:38 | ||
err = nil | ||
} | ||
if err == nil { | ||
log.Info(ctx, "Attestation successfully submitted to beacon node", | ||
z.Any("delay", b.delayFunc(duty.Slot)), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters