File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,10 @@ impl FlashblocksReceiverService {
46
46
let msg = msg?;
47
47
match msg {
48
48
Message :: Text ( text) => {
49
- if let Ok ( flashblocks_msg ) = serde_json:: from_str :: < FlashblocksPayloadV1 > ( & text)
50
- // TODO: Version this
51
- {
52
- self . sender . send ( flashblocks_msg ) . await ? ;
49
+ match serde_json:: from_str :: < FlashblocksPayloadV1 > ( & text) {
50
+ // TODO: Version this
51
+ Ok ( flashblocks_msg ) => self . sender . send ( flashblocks_msg ) . await ? ,
52
+ Err ( e ) => error ! ( "Failed to parse inbound flashblock: {}" , e ) ,
53
53
}
54
54
}
55
55
_ => continue ,
Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ pub struct ExecutionPayloadFlashblockDeltaV1 {
26
26
pub transactions : Vec < Bytes > ,
27
27
/// Array of [`Withdrawal`] enabled with V2
28
28
pub withdrawals : Vec < Withdrawal > ,
29
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
29
30
/// The withdrawals root of the block.
30
- pub withdrawals_root : B256 ,
31
+ pub withdrawals_root : Option < B256 > ,
31
32
}
32
33
33
34
/// Represents the base configuration of an execution payload that remains constant
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ use thiserror::Error;
17
17
use tokio:: sync:: RwLock ;
18
18
use tokio:: sync:: mpsc;
19
19
use tracing:: error;
20
+
20
21
#[ derive( Debug , Error ) ]
21
22
pub enum FlashblocksError {
22
23
#[ error( "Missing base payload for initial flashblock" ) ]
@@ -29,6 +30,8 @@ pub enum FlashblocksError {
29
30
InvalidIndex ,
30
31
#[ error( "Missing payload" ) ]
31
32
MissingPayload ,
33
+ #[ error( "Malformed flashblock" ) ]
34
+ MalformedFlashblock ,
32
35
}
33
36
34
37
#[ derive( Debug , Deserialize , Serialize ) ]
@@ -158,7 +161,9 @@ impl FlashblockBuilder {
158
161
} ,
159
162
should_override_builder : false ,
160
163
execution_payload : OpExecutionPayloadV4 {
161
- withdrawals_root,
164
+ // In version 4 withdrawals_root should be present
165
+ withdrawals_root : withdrawals_root
166
+ . ok_or ( FlashblocksError :: MalformedFlashblock ) ?,
162
167
payload_inner : execution_payload,
163
168
} ,
164
169
execution_requests : vec ! [ ] ,
You can’t perform that action at this time.
0 commit comments