@@ -32,7 +32,7 @@ use tracing::{debug, info, warn};
3232const DELAYED_L1_PROPOSAL_BUFFER : u64 = 4 ;
3333
3434pub struct ExecutionLayer {
35- provider_ws : DynProvider ,
35+ provider : DynProvider ,
3636 preconfer_address : Address ,
3737 contract_addresses : ContractAddresses ,
3838 pacaya_config : taiko_inbox:: ITaikoInbox :: Config ,
@@ -49,9 +49,9 @@ impl ExecutionLayer {
4949 transaction_error_channel : Sender < TransactionError > ,
5050 metrics : Arc < metrics:: Metrics > ,
5151 ) -> Result < Self , Error > {
52- let ( provider_ws , preconfer_address) = alloy_tools:: construct_alloy_provider (
52+ let ( provider , preconfer_address) = alloy_tools:: construct_alloy_provider (
5353 & config. signer ,
54- & config. execution_ws_rpc_url ,
54+ & config. execution_rpc_url ,
5555 config. preconfer_address ,
5656 )
5757 . await ?;
@@ -61,17 +61,17 @@ impl ExecutionLayer {
6161
6262 let taiko_wrapper_contract = taiko_wrapper:: TaikoWrapper :: new (
6363 config. contract_addresses . taiko_wrapper ,
64- provider_ws . clone ( ) ,
64+ provider . clone ( ) ,
6565 ) ;
6666
67- let chain_id = provider_ws
67+ let chain_id = provider
6868 . get_chain_id ( )
6969 . await
7070 . map_err ( |e| Error :: msg ( format ! ( "Failed to get chain ID: {e}" ) ) ) ?;
7171 info ! ( "L1 Chain ID: {}" , chain_id) ;
7272
7373 let transaction_monitor = TransactionMonitor :: new (
74- provider_ws . clone ( ) ,
74+ provider . clone ( ) ,
7575 & config,
7676 transaction_error_channel,
7777 metrics. clone ( ) ,
@@ -81,12 +81,12 @@ impl ExecutionLayer {
8181 . map_err ( |e| Error :: msg ( format ! ( "Failed to create TransactionMonitor: {e}" ) ) ) ?;
8282
8383 let pacaya_config =
84- Self :: fetch_pacaya_config ( & config. contract_addresses . taiko_inbox , & provider_ws )
84+ Self :: fetch_pacaya_config ( & config. contract_addresses . taiko_inbox , & provider )
8585 . await
8686 . map_err ( |e| Error :: msg ( format ! ( "Failed to fetch pacaya config: {e}" ) ) ) ?;
8787
8888 Ok ( Self {
89- provider_ws ,
89+ provider ,
9090 preconfer_address,
9191 contract_addresses : config. contract_addresses ,
9292 pacaya_config,
@@ -104,7 +104,7 @@ impl ExecutionLayer {
104104
105105 async fn get_operator_for_current_epoch ( & self ) -> Result < Address , Error > {
106106 let contract =
107- PreconfWhitelist :: new ( self . contract_addresses . preconf_whitelist , & self . provider_ws ) ;
107+ PreconfWhitelist :: new ( self . contract_addresses . preconf_whitelist , & self . provider ) ;
108108 let operator = contract
109109 . getOperatorForCurrentEpoch ( )
110110 . block ( alloy:: eips:: BlockId :: pending ( ) )
@@ -121,7 +121,7 @@ impl ExecutionLayer {
121121
122122 async fn get_operator_for_next_epoch ( & self ) -> Result < Address , Error > {
123123 let contract =
124- PreconfWhitelist :: new ( self . contract_addresses . preconf_whitelist , & self . provider_ws ) ;
124+ PreconfWhitelist :: new ( self . contract_addresses . preconf_whitelist , & self . provider ) ;
125125 let operator = contract
126126 . getOperatorForNextEpoch ( )
127127 . block ( alloy:: eips:: BlockId :: pending ( ) )
@@ -207,7 +207,7 @@ impl ExecutionLayer {
207207 ) ;
208208
209209 // Build proposeBatch transaction
210- let builder = ProposeBatchBuilder :: new ( self . provider_ws . clone ( ) , self . extra_gas_percentage ) ;
210+ let builder = ProposeBatchBuilder :: new ( self . provider . clone ( ) , self . extra_gas_percentage ) ;
211211 let tx = builder
212212 . build_propose_batch_tx (
213213 self . preconfer_address ,
@@ -233,9 +233,9 @@ impl ExecutionLayer {
233233
234234 async fn fetch_pacaya_config (
235235 taiko_inbox_address : & Address ,
236- ws_provider : & DynProvider ,
236+ provider : & DynProvider ,
237237 ) -> Result < taiko_inbox:: ITaikoInbox :: Config , Error > {
238- let contract = taiko_inbox:: ITaikoInbox :: new ( * taiko_inbox_address, ws_provider ) ;
238+ let contract = taiko_inbox:: ITaikoInbox :: new ( * taiko_inbox_address, provider ) ;
239239 let pacaya_config = contract. pacayaConfig ( ) . call ( ) . await ?;
240240
241241 info ! (
@@ -255,7 +255,7 @@ impl ExecutionLayer {
255255
256256 pub async fn get_preconfer_inbox_bonds ( & self ) -> Result < alloy:: primitives:: U256 , Error > {
257257 let contract =
258- taiko_inbox:: ITaikoInbox :: new ( self . contract_addresses . taiko_inbox , & self . provider_ws ) ;
258+ taiko_inbox:: ITaikoInbox :: new ( self . contract_addresses . taiko_inbox , & self . provider ) ;
259259 let bonds_balance = contract
260260 . bondBalanceOf ( self . preconfer_address )
261261 . call ( )
@@ -271,7 +271,7 @@ impl ExecutionLayer {
271271 . get_or_try_init ( || async {
272272 let contract = taiko_inbox:: ITaikoInbox :: new (
273273 self . contract_addresses . taiko_inbox ,
274- self . provider_ws . clone ( ) ,
274+ self . provider . clone ( ) ,
275275 ) ;
276276 let taiko_token = contract
277277 . bondToken ( )
@@ -283,7 +283,7 @@ impl ExecutionLayer {
283283 } )
284284 . await ?;
285285
286- let contract = IERC20 :: new ( * taiko_token, & self . provider_ws ) ;
286+ let contract = IERC20 :: new ( * taiko_token, & self . provider ) ;
287287 let allowance = contract
288288 . allowance ( self . preconfer_address , self . contract_addresses . taiko_inbox )
289289 . call ( )
@@ -315,7 +315,7 @@ impl ExecutionLayer {
315315 }
316316
317317 pub async fn get_preconfer_wallet_eth ( & self ) -> Result < alloy:: primitives:: U256 , Error > {
318- let balance = self . provider_ws . get_balance ( self . preconfer_address ) . await ?;
318+ let balance = self . provider . get_balance ( self . preconfer_address ) . await ?;
319319 Ok ( balance)
320320 }
321321
@@ -340,15 +340,15 @@ impl ExecutionLayer {
340340 }
341341
342342 pub async fn get_l1_height ( & self ) -> Result < u64 , Error > {
343- self . provider_ws
343+ self . provider
344344 . get_block_number ( )
345345 . await
346346 . map_err ( |e| Error :: msg ( format ! ( "Failed to get L1 height: {e}" ) ) )
347347 }
348348
349349 pub async fn get_block_state_root_by_number ( & self , number : u64 ) -> Result < B256 , Error > {
350350 let block = self
351- . provider_ws
351+ . provider
352352 . get_block_by_number ( BlockNumberOrTag :: Number ( number) )
353353 . await
354354 . map_err ( |e| Error :: msg ( format ! ( "Failed to get block by number ({number}): {e}" ) ) ) ?
@@ -359,7 +359,7 @@ impl ExecutionLayer {
359359 pub async fn get_l2_height_from_taiko_inbox ( & self ) -> Result < u64 , Error > {
360360 let contract = taiko_inbox:: ITaikoInbox :: new (
361361 self . contract_addresses . taiko_inbox ,
362- self . provider_ws . clone ( ) ,
362+ self . provider . clone ( ) ,
363363 ) ;
364364 let num_batches = contract. getStats2 ( ) . call ( ) . await ?. numBatches ;
365365 // It is safe because num_batches initial value is 1
@@ -370,7 +370,7 @@ impl ExecutionLayer {
370370
371371 pub async fn get_preconfer_nonce_latest ( & self ) -> Result < u64 , Error > {
372372 let nonce_str: String = self
373- . provider_ws
373+ . provider
374374 . client ( )
375375 . request (
376376 "eth_getTransactionCount" ,
@@ -385,7 +385,7 @@ impl ExecutionLayer {
385385
386386 pub async fn get_preconfer_nonce_pending ( & self ) -> Result < u64 , Error > {
387387 let nonce_str: String = self
388- . provider_ws
388+ . provider
389389 . client ( )
390390 . request (
391391 "eth_getTransactionCount" ,
@@ -408,7 +408,7 @@ impl ExecutionLayer {
408408 block_number_or_tag : BlockNumberOrTag ,
409409 ) -> Result < u64 , Error > {
410410 let block = self
411- . provider_ws
411+ . provider
412412 . get_block_by_number ( block_number_or_tag)
413413 . await ?
414414 . ok_or ( anyhow:: anyhow!(
@@ -421,7 +421,7 @@ impl ExecutionLayer {
421421 pub async fn get_forced_inclusion_head ( & self ) -> Result < u64 , Error > {
422422 let contract = IForcedInclusionStore :: new (
423423 self . contract_addresses . forced_inclusion_store ,
424- self . provider_ws . clone ( ) ,
424+ self . provider . clone ( ) ,
425425 ) ;
426426 contract
427427 . head ( )
@@ -433,7 +433,7 @@ impl ExecutionLayer {
433433 pub async fn get_forced_inclusion_tail ( & self ) -> Result < u64 , Error > {
434434 let contract = IForcedInclusionStore :: new (
435435 self . contract_addresses . forced_inclusion_store ,
436- self . provider_ws . clone ( ) ,
436+ self . provider . clone ( ) ,
437437 ) ;
438438 contract
439439 . tail ( )
@@ -445,7 +445,7 @@ impl ExecutionLayer {
445445 pub async fn get_forced_inclusion ( & self , index : u64 ) -> Result < ForcedInclusion , Error > {
446446 let contract = IForcedInclusionStore :: new (
447447 self . contract_addresses . forced_inclusion_store ,
448- self . provider_ws . clone ( ) ,
448+ self . provider . clone ( ) ,
449449 ) ;
450450 contract
451451 . getForcedInclusion ( U256 :: from ( index) )
@@ -508,7 +508,7 @@ impl ExecutionLayer {
508508 let metrics = Arc :: new ( Metrics :: new ( ) ) ;
509509
510510 let ethereum_l1_config = EthereumL1Config {
511- execution_ws_rpc_url : ws_rpc_url,
511+ execution_rpc_url : ws_rpc_url,
512512 contract_addresses : ContractAddresses {
513513 taiko_inbox : Address :: ZERO ,
514514 taiko_token : OnceCell :: new ( ) ,
@@ -534,7 +534,7 @@ impl ExecutionLayer {
534534 // Self::new(ethereum_l1_config, tx_error_sender, metrics.clone()).await
535535
536536 Ok ( Self {
537- provider_ws : provider_ws. clone ( ) ,
537+ provider : provider_ws. clone ( ) ,
538538 preconfer_address : preconfer_address. parse ( ) ?,
539539 contract_addresses : ethereum_l1_config. contract_addresses . clone ( ) ,
540540 pacaya_config : taiko_inbox:: ITaikoInbox :: Config {
@@ -602,7 +602,7 @@ impl ExecutionLayer {
602602 }
603603 }
604604
605- let contract = Counter :: deploy ( & self . provider_ws ) . await ?;
605+ let contract = Counter :: deploy ( & self . provider ) . await ?;
606606
607607 let builder = contract. setNumber ( alloy:: primitives:: U256 :: from ( 42 ) ) ;
608608 let tx_hash = builder. send ( ) . await ?. watch ( ) . await ?;
0 commit comments