From d5b26305d15437f8298e4c1575cdd8a7cd6c68d1 Mon Sep 17 00:00:00 2001 From: Ethen Pociask Date: Wed, 4 Dec 2024 23:56:19 +0700 Subject: [PATCH 1/2] fix: (ODA-03) Optimized failover to Eth DA --- arbnode/batch_poster.go | 8 ++------ system_tests/eigenda_test.go | 5 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index 5a2ab45c6..623d68d3a 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -174,7 +174,6 @@ type BatchPosterConfig struct { RedisLock redislock.SimpleCfg `koanf:"redis-lock" reload:"hot"` ExtraBatchGas uint64 `koanf:"extra-batch-gas" reload:"hot"` Post4844Blobs bool `koanf:"post-4844-blobs" reload:"hot"` - PostEigenDA bool `koanf:"post-eigen-da" reload:"hot"` IgnoreBlobPrice bool `koanf:"ignore-blob-price" reload:"hot"` ParentChainWallet genericconf.WalletConfig `koanf:"parent-chain-wallet"` L1BlockBound string `koanf:"l1-block-bound" reload:"hot"` @@ -231,7 +230,6 @@ func BatchPosterConfigAddOptions(prefix string, f *pflag.FlagSet) { f.String(prefix+".gas-refunder-address", DefaultBatchPosterConfig.GasRefunderAddress, "The gas refunder contract address (optional)") f.Uint64(prefix+".extra-batch-gas", DefaultBatchPosterConfig.ExtraBatchGas, "use this much more gas than estimation says is necessary to post batches") f.Bool(prefix+".post-4844-blobs", DefaultBatchPosterConfig.Post4844Blobs, "if the parent chain supports 4844 blobs and they're well priced, post EIP-4844 blobs") - f.Bool(prefix+".post-eigen-da", DefaultBatchPosterConfig.PostEigenDA, "Post data to EigenDA") f.Bool(prefix+".ignore-blob-price", DefaultBatchPosterConfig.IgnoreBlobPrice, "if the parent chain supports 4844 blobs and ignore-blob-price is true, post 4844 blobs even if it's not price efficient") f.String(prefix+".redis-url", DefaultBatchPosterConfig.RedisUrl, "if non-empty, the Redis URL to store queued transactions in") f.String(prefix+".l1-block-bound", DefaultBatchPosterConfig.L1BlockBound, "only post messages to batches when they're within the max future block/timestamp as of this L1 block tag (\"safe\", \"finalized\", \"latest\", or \"ignore\" to ignore this check)") @@ -263,7 +261,6 @@ var DefaultBatchPosterConfig = BatchPosterConfig{ GasRefunderAddress: "", ExtraBatchGas: 50_000, Post4844Blobs: false, - PostEigenDA: false, IgnoreBlobPrice: false, DataPoster: dataposter.DefaultDataPosterConfig, ParentChainWallet: DefaultBatchPosterL1WalletConfig, @@ -298,7 +295,6 @@ var TestBatchPosterConfig = BatchPosterConfig{ GasRefunderAddress: "", ExtraBatchGas: 10_000, Post4844Blobs: true, - PostEigenDA: false, IgnoreBlobPrice: false, DataPoster: dataposter.TestDataPosterConfig, ParentChainWallet: DefaultBatchPosterL1WalletConfig, @@ -323,7 +319,6 @@ var EigenDABatchPosterConfig = BatchPosterConfig{ GasRefunderAddress: "", ExtraBatchGas: 10_000, Post4844Blobs: false, - PostEigenDA: true, IgnoreBlobPrice: false, DataPoster: dataposter.TestDataPosterConfig, ParentChainWallet: DefaultBatchPosterL1WalletConfig, @@ -1490,7 +1485,6 @@ func (b *BatchPoster) maybePostSequencerBatch(ctx context.Context) (bool, error) // However, this is a rare event and the performance impact is minimal. log.Error("EigenDA service is unavailable and anytrust is disabled, failing over to ETH DA") - b.eigenDAFailoverToETHDA = true // // if the batch's size exceeds the native DA max size limit, we must re-encode the batch to accomodate the AnyTrust, calldata, and 4844 size limits if (len(sequencerMsg) > b.config().MaxSize && !b.building.use4844) || (len(sequencerMsg) > b.config().Max4844BatchSize && b.building.use4844) { @@ -1501,6 +1495,8 @@ func (b *BatchPoster) maybePostSequencerBatch(ctx context.Context) (bool, error) return false, nil } + b.building.useEigenDA = false + failOver = true } if err != nil && !failOver { diff --git a/system_tests/eigenda_test.go b/system_tests/eigenda_test.go index 2126a6b84..dea2d227c 100644 --- a/system_tests/eigenda_test.go +++ b/system_tests/eigenda_test.go @@ -64,7 +64,7 @@ func TestEigenDAProxyBatchPosting(t *testing.T) { } } -func TestEigenDAProxyFailOverToETHDA(t *testing.T) { +func TestFailOverFromEigenDAToCallData(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer func() { cancel() @@ -105,6 +105,7 @@ func TestEigenDAProxyFailOverToETHDA(t *testing.T) { // 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) + // 3 - Emulate EigenDA becoming healthy again and ensure that the system starts using it for DA eigenWriter, _ := eigenda.NewEigenDA(&eigenda.EigenDAConfig{ Enable: true, @@ -119,7 +120,7 @@ func TestEigenDAProxyFailOverToETHDA(t *testing.T) { } } -func TestEigenDAProxyFailOverToAnyTrust(t *testing.T) { +func TestFailOverFromEigenDAToAnyTrust(t *testing.T) { initTest(t) ctx, cancel := context.WithCancel(context.Background()) defer cancel() From 8cf01a30366d99e7802c6bd0291fdd8b9cff6d75 Mon Sep 17 00:00:00 2001 From: Ethen Pociask Date: Wed, 4 Dec 2024 23:59:28 +0700 Subject: [PATCH 2/2] fix: (ODA-03) Optimized failover to Eth DA - bring back eigenDAFailoverToETHDA boolean --- arbnode/batch_poster.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index 623d68d3a..41406178b 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -1486,11 +1486,12 @@ func (b *BatchPoster) maybePostSequencerBatch(ctx context.Context) (bool, error) log.Error("EigenDA service is unavailable and anytrust is disabled, failing over to ETH DA") - // // if the batch's size exceeds the native DA max size limit, we must re-encode the batch to accomodate the AnyTrust, calldata, and 4844 size limits + // if the batch's size exceeds the native DA max size limit, we must re-encode the batch to accomodate the AnyTrust, calldata, and 4844 size limits if (len(sequencerMsg) > b.config().MaxSize && !b.building.use4844) || (len(sequencerMsg) > b.config().Max4844BatchSize && b.building.use4844) { batchPosterDAFailureCounter.Inc(1) batchPosterDAFailoverCount.Inc(1) + b.eigenDAFailoverToETHDA = true b.building = nil return false, nil }