From 557019eb8960c6b84836e95963de92021f1014ac Mon Sep 17 00:00:00 2001 From: pgherveou Date: Wed, 8 Jan 2025 21:31:11 +0100 Subject: [PATCH] Fix up some rpc data --- .../frame/revive/rpc/examples/js/bun.lockb | Bin 43178 -> 41698 bytes .../frame/revive/rpc/examples/js/package.json | 8 ++--- .../rpc/examples/js/pvm/FlipperCaller.polkavm | Bin 5260 -> 4532 bytes .../rpc/examples/js/src/build-contracts.ts | 2 +- substrate/frame/revive/rpc/src/client.rs | 30 +++++++++++++++--- substrate/frame/revive/rpc/src/lib.rs | 8 ++--- .../frame/revive/src/evm/api/rpc_types_gen.rs | 10 +++--- 7 files changed, 40 insertions(+), 18 deletions(-) diff --git a/substrate/frame/revive/rpc/examples/js/bun.lockb b/substrate/frame/revive/rpc/examples/js/bun.lockb index e800d6d4d2d9d684d5e3b778792bc3fe6c545c40..6d6cb9e6699858db1bbe6a889c1441d78a59b5db 100755 GIT binary patch delta 8112 zcmeHMX;f5Kw!Zg52~}7WC}J@f!5NvSVzdA!pb8XFQ#hfhrIa!#GbmCxf(a&M=h@My ziKcyO1`~s6H65cS=}tm437SElCY`B$>Pu`*)I?)zfBRNlv6FPx>eX+(^?vk$?|l30 zeeN0d8S317p6-^u_=EItM97_mFYNmAp!CUsFE8s>d_+4F_uG?yczT^t2J3iic=RTZUkp%$vk7BdN_Tm?bRdTUv&wNena zAk7smtO~CxDUKD|k@iA*l`~(hD=idcxA5IEVX?++e~^fkD*c@Tt;APfZWck)Is7trWT7lFB=G2j5O0n9Fj zdu10duC!KH+j!DB(!GKmQ}L%mW^(E~KA7f}RkpSB_NHy|F0X#)d-S&rZ5#CauDcsv zI~;h%?dFQ-4$b}>nSI;?m^=0lpZ z3EHyy$j)7^LtNC+XeXAM;7i@=P_p}~Dce0w`cR;C?ncpz-bTVKQkREOS|gIFw^2OG zI@K*v5R$0fJw-~FXq|^qRfj^7=r|NFNTh+{3KTKau1S#wyO74+s4l_63`1=Kb-O1> z`(0?A+9=&{Ar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N=09d!Ox!@DmBy!eq{J_Ohw-OwRN$*s;QN2y^#HkmTLs46q+w^I z$wmHL9-(<_|sUkHy~CMRPaYZgFt$sT4eLZNWT?%n@Y%sbGHJ(>B!hRC-7hP1M$%-YNKn5mLvghj7D$piXeTE1dcw zZg^QxU-tH{cpLtT2e|Z>ynb)DQ469rBlqN2uV6e!m927yY=ePS;mXU^+ot!*{FKzCjjQSxRlV3%{9e~iSXZZ2 zJ+<7$HNkhiP|Htqe21P&6ur~G&F#X*>97b!lGJ zXQZZYye#R<-lOh|}pnn)HC!RDFq@o|v)2{_r|axbby_}S8-r&D?{$WPDD z1OownTH8}BreBy>L0flMb8~Zb(|l2FafKv`pkqr@^=3F<3 z9&h-ULSer7WV{(PY^qqH>iV*tDuSNw!E~w+2BadOJ5iibPZSF9x?L~Ci;L5R=H^!T p0iJPEr`48Crt_eP`(5u!e^Y{pr@VaA1f^>c;4;vn{{v=KaybA1 diff --git a/substrate/frame/revive/rpc/examples/js/src/build-contracts.ts b/substrate/frame/revive/rpc/examples/js/src/build-contracts.ts index 446a629b123f..f26f275ec3d5 100644 --- a/substrate/frame/revive/rpc/examples/js/src/build-contracts.ts +++ b/substrate/frame/revive/rpc/examples/js/src/build-contracts.ts @@ -55,7 +55,7 @@ for (const file of input) { } console.log('Compiling with revive...') - const reviveOut = await compile(input, { wasm: !!process.env.WASM }) + const reviveOut = await compile(input, { bin: 'resolc' }) for (const contracts of Object.values(reviveOut.contracts)) { for (const [name, contract] of Object.entries(contracts)) { diff --git a/substrate/frame/revive/rpc/src/client.rs b/substrate/frame/revive/rpc/src/client.rs index 1162b9c9d887..1c403a3c517c 100644 --- a/substrate/frame/revive/rpc/src/client.rs +++ b/substrate/frame/revive/rpc/src/client.rs @@ -22,12 +22,12 @@ use crate::{ subxt_client::{ revive::calls::types::EthTransact, runtime_types::pallet_revive::storage::ContractInfo, }, - BlockInfoProvider, ReceiptProvider, LOG_TARGET, + BlockInfoProvider, ReceiptProvider, TransactionInfo, LOG_TARGET, }; use jsonrpsee::types::{error::CALL_EXECUTION_FAILED_CODE, ErrorObjectOwned}; use pallet_revive::{ evm::{ - Block, BlockNumberOrTag, BlockNumberOrTagOrHash, Bytes256, GenericTransaction, ReceiptInfo, + Block, BlockNumberOrTag, BlockNumberOrTagOrHash, GenericTransaction, ReceiptInfo, SyncingProgress, SyncingStatus, TransactionSigned, H160, H256, U256, }, EthTransactError, EthTransactInfo, @@ -668,7 +668,11 @@ impl Client { } /// Get the EVM block for the given hash. - pub async fn evm_block(&self, block: Arc) -> Result { + pub async fn evm_block( + &self, + block: Arc, + hydrated_transactions: bool, + ) -> Result { let runtime_api = self.api.runtime_api().at(block.hash()); let max_fee = Self::weight_to_fee(&runtime_api, self.max_block_weight()).await?; let gas_limit = gas_from_fee(max_fee); @@ -681,6 +685,23 @@ impl Client { let state_root = header.state_root.0.into(); let extrinsics_root = header.extrinsics_root.0.into(); + let receipts = extract_receipts_from_block(&block).await?; + let gas_used = + receipts.iter().fold(U256::zero(), |acc, (_, receipt)| acc + receipt.gas_used); + let transactions = if hydrated_transactions { + receipts + .into_iter() + .map(|(signed_tx, receipt)| TransactionInfo::new(receipt, signed_tx).into()) + .collect::>() + .into() + } else { + receipts + .into_iter() + .map(|(_, receipt)| receipt.transaction_hash) + .collect::>() + .into() + }; + Ok(Block { hash: block.hash(), parent_hash, @@ -690,8 +711,9 @@ impl Client { timestamp: timestamp.into(), difficulty: Some(0u32.into()), gas_limit, - logs_bloom: Bytes256([0u8; 256]), + gas_used, receipts_root: extrinsics_root, + transactions, ..Default::default() }) } diff --git a/substrate/frame/revive/rpc/src/lib.rs b/substrate/frame/revive/rpc/src/lib.rs index 5e737eb4f932..74ddd307b112 100644 --- a/substrate/frame/revive/rpc/src/lib.rs +++ b/substrate/frame/revive/rpc/src/lib.rs @@ -203,12 +203,12 @@ impl EthRpcServer for EthRpcServerImpl { async fn get_block_by_hash( &self, block_hash: H256, - _hydrated_transactions: bool, + hydrated_transactions: bool, ) -> RpcResult> { let Some(block) = self.client.block_by_hash(&block_hash).await? else { return Ok(None); }; - let block = self.client.evm_block(block).await?; + let block = self.client.evm_block(block, hydrated_transactions).await?; Ok(Some(block)) } @@ -238,12 +238,12 @@ impl EthRpcServer for EthRpcServerImpl { async fn get_block_by_number( &self, block: BlockNumberOrTag, - _hydrated_transactions: bool, + hydrated_transactions: bool, ) -> RpcResult> { let Some(block) = self.client.block_by_number_or_tag(&block).await? else { return Ok(None); }; - let block = self.client.evm_block(block).await?; + let block = self.client.evm_block(block, hydrated_transactions).await?; Ok(Some(block)) } diff --git a/substrate/frame/revive/src/evm/api/rpc_types_gen.rs b/substrate/frame/revive/src/evm/api/rpc_types_gen.rs index 1d65fdefdde6..5d31613ca314 100644 --- a/substrate/frame/revive/src/evm/api/rpc_types_gen.rs +++ b/substrate/frame/revive/src/evm/api/rpc_types_gen.rs @@ -87,7 +87,7 @@ pub struct Block { /// Total difficulty #[serde(rename = "totalDifficulty", skip_serializing_if = "Option::is_none")] pub total_difficulty: Option, - pub transactions: H256OrTransactionInfo, + pub transactions: HashesOrTransactionInfos, /// Transactions root #[serde(rename = "transactionsRoot")] pub transactions_root: H256, @@ -357,15 +357,15 @@ pub enum BlockTag { Debug, Clone, Encode, Decode, TypeInfo, Serialize, Deserialize, From, TryInto, Eq, PartialEq, )] #[serde(untagged)] -pub enum H256OrTransactionInfo { +pub enum HashesOrTransactionInfos { /// Transaction hashes - H256s(Vec), + Hashes(Vec), /// Full transactions TransactionInfos(Vec), } -impl Default for H256OrTransactionInfo { +impl Default for HashesOrTransactionInfos { fn default() -> Self { - H256OrTransactionInfo::H256s(Default::default()) + HashesOrTransactionInfos::Hashes(Default::default()) } }