Skip to content

Commit 27a32c9

Browse files
chattonjulienrbrt
andauthored
fix: fix full node evm e2e (#2669)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview The E2E test was stalling on the DAIncludedHeight due to a signing verification error. We were signing the header instead of the data which is required in the `da_retreiver`. The height was also not being incremented when there was empty data. I added additional logic to increment the DA height on successful DA retrieval even if there are no events. <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> --> --------- Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent 7007f9a commit 27a32c9

4 files changed

Lines changed: 9 additions & 22 deletions

File tree

block/internal/syncing/da_retriever.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,9 @@ func (r *DARetriever) assertValidSignedData(signedData *types.SignedData) error
327327
return err
328328
}
329329

330-
// Create a header from the signed data metadata for signature verification
331-
header := types.Header{
332-
BaseHeader: types.BaseHeader{
333-
ChainID: signedData.ChainID(),
334-
Height: signedData.Height(),
335-
Time: uint64(signedData.Time().UnixNano()),
336-
},
337-
}
338-
339-
// Use the configured sync node signature bytes provider
340-
dataBytes, err := r.options.SyncNodeSignatureBytesProvider(context.Background(), &header, &signedData.Data)
330+
dataBytes, err := signedData.Data.MarshalBinary()
341331
if err != nil {
342-
return fmt.Errorf("failed to get signature payload: %w", err)
332+
return fmt.Errorf("failed to get signed data payload: %w", err)
343333
}
344334

345335
valid, err := signedData.Signer.PubKey.Verify(dataBytes, signedData.Signature)

block/internal/syncing/da_retriever_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ func makeSignedDataBytes(t *testing.T, chainID string, height uint64, proposer [
5656
}
5757
}
5858

59-
header := &types.Header{BaseHeader: types.BaseHeader{ChainID: chainID, Height: height, Time: d.Metadata.Time}}
60-
// sign using the sync provider (defaults to header bytes)
61-
bz, err := types.DefaultSyncNodeSignatureBytesProvider(context.Background(), header, d)
59+
// For DA SignedData, sign the Data payload bytes (matches DA submission logic)
60+
payload, err := d.MarshalBinary()
6261
require.NoError(t, err)
63-
sig, err := signer.Sign(bz)
62+
sig, err := signer.Sign(payload)
6463
require.NoError(t, err)
6564
sd := &types.SignedData{Data: *d, Signature: sig, Signer: types.Signer{PubKey: pub, Address: proposer}}
6665
bin, err := sd.MarshalBinary()

block/internal/syncing/syncer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ syncLoop:
282282
nextDARequestAt = time.Time{}
283283
s.logger.Error().Err(err).Msg("failed to retrieve from DA")
284284
}
285-
} else if len(events) > 0 {
285+
} else {
286286
// Reset backoff on success
287287
nextDARequestAt = time.Time{}
288288

test/e2e/evm_full_node_e2e_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ func TestEvmSequencerWithFullNodeE2E(t *testing.T) {
425425

426426
t.Logf("Full node block height before DA inclusion wait: %d", fnBlockHeightBeforeWait)
427427

428-
// Wait for one DA block time to allow DA inclusion to process
429-
waitTime := 1 * time.Second
430-
t.Logf("Waiting %v (1 DA block time) for DA inclusion to process...", waitTime)
428+
// Wait a few seconds to allow DA inclusion to process
429+
waitTime := 2 * time.Second
430+
t.Logf("Waiting %v 2s for DA inclusion to process...", waitTime)
431431
time.Sleep(waitTime)
432432

433433
// Get the DA included height from full node after the wait
@@ -461,8 +461,6 @@ func TestEvmSequencerWithFullNodeE2E(t *testing.T) {
461461
t.Logf(" • Final sequencer height: %d", seqHeight)
462462
t.Logf(" • Final full node height: %d", fnHeight)
463463
t.Logf(" • State root verification range: blocks %d-%d", startHeight, endHeight)
464-
t.Logf(" • Full node block height before DA wait: %d", fnBlockHeightBeforeWait)
465-
t.Logf(" • DA wait time: %v (1 DA block time)", waitTime)
466464
t.Logf(" • Full node DA included height after wait: %d", fnDAIncludedHeight)
467465
t.Logf("")
468466
t.Logf(" ✅ Verified Components:")

0 commit comments

Comments
 (0)