File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -566,6 +566,10 @@ export class HistoryNetwork extends BaseNetwork {
566
566
567
567
case HistoryNetworkContentType . EphemeralHeader : {
568
568
const payload = EphemeralHeaderPayload . deserialize ( value )
569
+ if ( payload . length === 0 ) {
570
+ this . logger . extend ( 'STORE' ) ( 'Received empty ephemeral header payload' )
571
+ return
572
+ }
569
573
try {
570
574
// Verify first header matches requested header
571
575
const firstHeader = BlockHeader . fromRLPSerializedHeader ( payload [ 0 ] , { setHardfork : true } )
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ describe('should be able to retrieve ephemeral headers from a peer', () => {
87
87
assert . fail ( 'Expected content in response' )
88
88
}
89
89
90
+ // Verify that we get a single ancestor for a content key with an ancestor count of 1
90
91
const contentKeyForOneAncestor = getContentKey ( HistoryNetworkContentType . EphemeralHeader , {
91
92
blockHash : headers [ 0 ] . hash ( ) ,
92
93
ancestorCount : 1 ,
@@ -116,5 +117,5 @@ describe('should be able to retrieve ephemeral headers from a peer', () => {
116
117
} else {
117
118
assert . fail ( 'Expected content in response' )
118
119
}
119
- } , 10000 )
120
+ } )
120
121
} )
You can’t perform that action at this time.
0 commit comments