File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ title: '[pallet-revive] fix subxt submit & add debug statments'
2+ doc:
3+ - audience: Runtime Dev
4+ description: |-
5+ - Fix subxt submit by default it's using `author_submitAndWatchExtrinsic` even though we just want to fire and forget
6+ - Add debug instructions to log the signer & nonce of new eth transactions when the node validate the transaction
7+ crates:
8+ - name: pallet-revive-eth-rpc
9+ bump: patch
10+ - name: pallet-revive
11+ bump: patch
Original file line number Diff line number Diff line change @@ -430,10 +430,14 @@ impl Client {
430430 pub async fn submit (
431431 & self ,
432432 call : subxt:: tx:: DefaultPayload < EthTransact > ,
433- ) -> Result < H256 , ClientError > {
433+ ) -> Result < ( ) , ClientError > {
434434 let ext = self . api . tx ( ) . create_unsigned ( & call) . map_err ( ClientError :: from) ?;
435- let hash = ext. submit ( ) . await ?;
436- Ok ( hash)
435+ let hash: H256 = self
436+ . rpc_client
437+ . request ( "author_submitExtrinsic" , rpc_params ! [ to_hex( ext. encoded( ) ) ] )
438+ . await ?;
439+ log:: debug!( target: LOG_TARGET , "Submitted transaction with substrate hash: {hash:?}" ) ;
440+ Ok ( ( ) )
437441 }
438442
439443 /// Get an EVM transaction receipt by hash.
@@ -749,3 +753,7 @@ impl Client {
749753 get_automine ( & self . rpc_client ) . await
750754 }
751755}
756+
757+ fn to_hex ( bytes : impl AsRef < [ u8 ] > ) -> String {
758+ format ! ( "0x{}" , hex:: encode( bytes. as_ref( ) ) )
759+ }
Original file line number Diff line number Diff line change @@ -175,6 +175,8 @@ impl EthRpcServer for EthRpcServerImpl {
175175 err
176176 } ) ?;
177177
178+ log:: debug!( target: LOG_TARGET , "send_raw_transaction with hash: {hash:?}" ) ;
179+
178180 // Wait for the transaction to be included in a block if automine is enabled
179181 if let Some ( mut receiver) = receiver {
180182 if let Err ( err) = tokio:: time:: timeout ( Duration :: from_millis ( 500 ) , async {
Original file line number Diff line number Diff line change @@ -299,6 +299,8 @@ pub trait EthExtra {
299299 log:: debug!( target: LOG_TARGET , "Failed to convert nonce" ) ;
300300 InvalidTransaction :: Call
301301 } ) ?;
302+
303+ log:: debug!( target: LOG_TARGET , "Decoded Ethereum transaction with signer: {signer_addr:?} nonce: {nonce:?}" ) ;
302304 let call_info = create_call :: < Self :: Config > ( tx, Some ( encoded_len as u32 ) ) ?;
303305 let storage_credit = <Self :: Config as Config >:: Currency :: withdraw (
304306 & signer,
You can’t perform that action at this time.
0 commit comments