@@ -7,8 +7,8 @@ use alloy::{
7
7
consensus:: { constants:: GWEI_TO_WEI , SimpleCoder } ,
8
8
eips:: BlockNumberOrTag ,
9
9
network:: { TransactionBuilder , TransactionBuilder4844 } ,
10
+ providers:: Provider as _,
10
11
providers:: SendableTx ,
11
- providers:: { Provider as _, WalletProvider } ,
12
12
rpc:: types:: eth:: TransactionRequest ,
13
13
signers:: Signer ,
14
14
sol_types:: SolCall ,
@@ -23,6 +23,7 @@ use std::time::Instant;
23
23
use tokio:: { sync:: mpsc, task:: JoinHandle } ;
24
24
use tracing:: { debug, error, instrument, trace} ;
25
25
use zenith_types:: {
26
+ bundle_helper:: { submitCall, BlockHeader , FillPermit2 } ,
26
27
SignRequest , SignResponse ,
27
28
Zenith :: { self , IncorrectHostBlock } ,
28
29
} ;
@@ -142,19 +143,33 @@ impl SubmitTask {
142
143
let r: FixedBytes < 32 > = resp. sig . r ( ) . into ( ) ;
143
144
let s: FixedBytes < 32 > = resp. sig . s ( ) . into ( ) ;
144
145
145
- let header = Zenith :: BlockHeader {
146
+ // TODO: Build fills
147
+ let fills: Vec < FillPermit2 > = vec ! [ ] ;
148
+
149
+ let header = BlockHeader {
146
150
hostBlockNumber : resp. req . host_block_number ,
147
151
rollupChainId : U256 :: from ( self . config . ru_chain_id ) ,
148
152
gasLimit : resp. req . gas_limit ,
149
153
rewardAddress : resp. req . ru_reward_address ,
150
154
blockDataHash : in_progress. contents_hash ( ) ,
151
155
} ;
152
156
153
- let tx = self
154
- . build_blob_tx ( header, v, r, s, in_progress) ?
155
- . with_from ( self . host_provider . default_signer_address ( ) )
156
- . with_to ( self . config . zenith_address )
157
- . with_gas_limit ( 1_000_000 ) ;
157
+ let submit_call = submitCall { fills, header, v, r, s } . abi_encode ( ) ;
158
+
159
+ let tx = TransactionRequest :: default ( )
160
+ . with_input ( submit_call)
161
+ . with_max_priority_fee_per_gas ( ( GWEI_TO_WEI * 16 ) as u128 ) ;
162
+
163
+ if let Err ( TransportError :: ErrorResp ( e) ) =
164
+ self . host_provider . call ( & tx) . block ( BlockNumberOrTag :: Pending . into ( ) ) . await
165
+ {
166
+ error ! (
167
+ code = e. code,
168
+ message = %e. message,
169
+ data = ?e. data,
170
+ "error in transaction submission"
171
+ ) ;
172
+ }
158
173
159
174
if let Err ( TransportError :: ErrorResp ( e) ) =
160
175
self . host_provider . call ( & tx) . block ( BlockNumberOrTag :: Pending . into ( ) ) . await
0 commit comments