@@ -13,7 +13,6 @@ import (
1313 "os"
1414 "path/filepath"
1515 "slices"
16- "strconv"
1716 "strings"
1817 "sync"
1918 "sync/atomic"
@@ -230,7 +229,7 @@ func TestLeaseFailoverE2E(t *testing.T) {
230229 }, 2 * must (time .ParseDuration (DefaultDABlockTime )), 100 * time .Millisecond )
231230
232231 t .Log ("+++ Verifying no DA gaps..." )
233- verifyBlocks (t , daStartHeight , lastDABlockNewLeader , jwtSecret , testEndpoints .GetDAAddress (), genesisHeight , state .LastBlockHeight )
232+ verifyDABlocks (t , daStartHeight , lastDABlockNewLeader , jwtSecret , testEndpoints .GetDAAddress (), genesisHeight , state .LastBlockHeight )
234233
235234 // Cleanup processes
236235 clusterNodes .killAll ()
@@ -260,13 +259,13 @@ func verifyNoDoubleSigning(t *testing.T, clusterNodes *raftClusterNodes, genesis
260259 require .NoError (t , err )
261260 t .Logf ("%s: %v" , nodes [0 ], rsp .Block )
262261 }
263- // t.FailNow()
262+ t .FailNow ()
264263 }
265264 }
266265}
267266
268- // verifyBlocks checks that DA block heights form a continuous sequence without gaps
269- func verifyBlocks (t * testing.T , daStartHeight , lastDABlock uint64 , jwtSecret string , daAddress string , genesisHeight , lastEVBlock uint64 ) {
267+ // verifyDABlocks checks that DA block heights form a continuous sequence without gaps
268+ func verifyDABlocks (t * testing.T , daStartHeight , lastDABlock uint64 , jwtSecret string , daAddress string , genesisHeight , lastEVBlock uint64 ) {
270269 t .Helper ()
271270 rpcClient , err := jsonrpc .NewClient (t .Context (), zerolog .Nop (), daAddress , jwtSecret , defaultMaxBlobSize )
272271 require .NoError (t , err )
@@ -287,8 +286,8 @@ func verifyBlocks(t *testing.T, daStartHeight, lastDABlock uint64, jwtSecret str
287286 require .NoError (t , err )
288287
289288 for _ , blob := range blobs {
290- if evHeight , hash := extractBlockHeight (t , blob ); evHeight != 0 {
291- t .Logf ("extracting block height from blob (da height %d): %x " , daHeight , evHeight )
289+ if evHeight , hash , blobType := extractBlockHeight (t , blob ); evHeight != 0 {
290+ t .Logf ("extracting block height from blob (da height %d): %4d (%s) " , daHeight , evHeight , blobType )
292291 if height , ok := deduplicationCache [hash .String ()]; ok {
293292 require .Equal (t , evHeight , height )
294293 continue
@@ -309,16 +308,21 @@ func verifyBlocks(t *testing.T, daStartHeight, lastDABlock uint64, jwtSecret str
309308}
310309
311310// extractBlockHeight attempts to decode a blob as SignedHeader or SignedData and extract the block height
312- func extractBlockHeight (t * testing.T , blob []byte ) (uint64 , types.Hash ) {
311+ func extractBlockHeight (t * testing.T , blob []byte ) (uint64 , types.Hash , string ) {
313312 t .Helper ()
313+ if len (blob ) == 0 {
314+ t .Log ("empty blob, skipping" )
315+ return 0 , nil , ""
316+ }
314317 var headerPb pb.SignedHeader
315318 if err := proto .Unmarshal (blob , & headerPb ); err == nil {
316319 var signedHeader types.SignedHeader
317320 if err := signedHeader .FromProto (& headerPb ); err == nil {
318321 if err := signedHeader .Header .ValidateBasic (); err == nil {
319- return signedHeader .Height (), signedHeader .Hash ()
322+ return signedHeader .Height (), signedHeader .Hash (), "header"
320323 } else {
321- t .Logf ("invalid header: %v" , err )
324+ jsonBZ , _ := json .MarshalIndent (signedHeader .Header , "" , " " )
325+ t .Logf ("invalid header: %v: %s" , err , string (jsonBZ ))
322326 }
323327 } else {
324328 t .Logf ("failed to unmarshal signed header: %v" , err )
@@ -330,12 +334,12 @@ func extractBlockHeight(t *testing.T, blob []byte) (uint64, types.Hash) {
330334 var signedData types.SignedData
331335 if err := signedData .UnmarshalBinary (blob ); err == nil {
332336 if signedData .Metadata != nil {
333- return signedData .Height (), signedData .Hash ()
337+ return signedData .Height (), signedData .Hash (), "data"
334338 }
335339 } else {
336340 t .Logf ("failed to unmarshal signed data: %v" , err )
337341 }
338- return 0 , nil
342+ return 0 , nil , ""
339343}
340344
341345func initChain (t * testing.T , sut * SystemUnderTest , workDir string ) string {
@@ -399,7 +403,7 @@ func setupRaftSequencerNode(
399403 "--evnode.raft.node_id=" + nodeID ,
400404 "--evnode.raft.raft_addr=" + raftAddr ,
401405 "--evnode.raft.raft_dir=" + raftDir ,
402- "--evnode.raft.bootstrap=" + strconv . FormatBool ( bootstrap ) ,
406+ "--evnode.raft.bootstrap=true" ,
403407 "--evnode.raft.peers=" + strings .Join (raftPeers , "," ),
404408 "--evnode.raft.snap_count=10" ,
405409 "--evnode.raft.send_timeout=300ms" ,
0 commit comments