Skip to content

Commit

Permalink
feat: EigenDA failover - fix AnyTrust failover bug
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Nov 7, 2024
1 parent dfa809a commit 9bb2e70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions arbnode/batch_poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type BatchPosterDangerousConfig struct {
type BatchPosterConfig struct {
Enable bool `koanf:"enable"`
DisableDapFallbackStoreDataOnChain bool `koanf:"disable-dap-fallback-store-data-on-chain" reload:"hot"`
EnableEigenDAFailover bool `koanf:"enable-eigenda-failover" reload:"hot"`
EnableEigenDAFailover bool `koanf:"eigenda-failover" reload:"hot"`

Check failure on line 153 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

field name: "EnableEigenDAFailover" doesn't match tag name: "eigendafailover"

Check failure on line 153 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

field name: "EnableEigenDAFailover" doesn't match tag name: "eigendafailover"

Check failure on line 153 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

field name: "EnableEigenDAFailover" doesn't match tag name: "eigendafailover"

Check failure on line 153 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

field name: "EnableEigenDAFailover" doesn't match tag name: "eigendafailover"

Check failure on line 153 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

field name: "EnableEigenDAFailover" doesn't match tag name: "eigendafailover"
// Max batch size.
MaxSize int `koanf:"max-size" reload:"hot"`
// Maximum 4844 blob enabled batch size.
Expand Down Expand Up @@ -217,7 +217,7 @@ type BatchPosterConfigFetcher func() *BatchPosterConfig
func BatchPosterConfigAddOptions(prefix string, f *pflag.FlagSet) {

Check failure on line 217 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

koanf tag name: "eigenda-failover" doesn't match the field: "EnableEigenDAFailover"

Check failure on line 217 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

koanf tag name: "eigenda-failover" doesn't match the field: "EnableEigenDAFailover"

Check failure on line 217 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

koanf tag name: "eigenda-failover" doesn't match the field: "EnableEigenDAFailover"

Check failure on line 217 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

koanf tag name: "eigenda-failover" doesn't match the field: "EnableEigenDAFailover"

Check failure on line 217 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

koanf tag name: "eigenda-failover" doesn't match the field: "EnableEigenDAFailover"
f.Bool(prefix+".enable", DefaultBatchPosterConfig.Enable, "enable posting batches to l1")
f.Bool(prefix+".disable-dap-fallback-store-data-on-chain", DefaultBatchPosterConfig.DisableDapFallbackStoreDataOnChain, "If unable to batch to DA provider, disable fallback storing data on chain")
f.Bool(prefix+".enable-eigenda-failover", DefaultBatchPosterConfig.EnableEigenDAFailover, "If EigenDA fails, failover to AnyTrust (if enabled) or native ETH DA")
f.Bool(prefix+".eigenda-failover", DefaultBatchPosterConfig.EnableEigenDAFailover, "If EigenDA fails, failover to AnyTrust (if enabled) or native ETH DA")
f.Int(prefix+".max-size", DefaultBatchPosterConfig.MaxSize, "maximum batch size")
f.Int(prefix+".max-4844-batch-size", DefaultBatchPosterConfig.Max4844BatchSize, "maximum 4844 blob enabled batch size")
f.Int(prefix+".max-eigenda-batch-size", DefaultBatchPosterConfig.MaxEigenDABatchSize, "maximum EigenDA blob enabled batch size")
Expand Down Expand Up @@ -1502,12 +1502,11 @@ func (b *BatchPoster) maybePostSequencerBatch(ctx context.Context) (bool, error)

}

if err != nil {
if err != nil && !failOver {
batchPosterDAFailureCounter.Inc(1)
return false, err
}

if failOver {
} else if failOver {
batchPosterDAFailoverCount.Inc(1)
} else {
batchPosterDASuccessCounter.Inc(1)
Expand Down
1 change: 0 additions & 1 deletion system_tests/eigenda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func TestEigenDAProxyFailOverToETHDA(t *testing.T) {
// 1 - Ensure that batches can be submitted and read via EigenDA batch posting
checkEigenDABatchPosting(t, ctx, builder.L1.Client, builder.L2.Client, builder.L1Info, builder.L2Info, big.NewInt(1e12), l2B.Client)

// time.Sleep(time.Second * 2)
// 2 - Cause EigenDA to fail and ensure that the system falls back to anytrust in the presence of 503 eigenda-proxy errors
builder.L2.ConsensusNode.BatchPoster.SetEigenDAClientMock()
checkBatchPosting(t, ctx, builder.L1.Client, builder.L2.Client, builder.L1Info, builder.L2Info, big.NewInt(2000000000000), l2B.Client)
Expand Down

0 comments on commit 9bb2e70

Please sign in to comment.