From 1d1408dfac41415006477dda1614adbe10e63b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20Stu=CC=88ber?= <15174476+TorstenStueber@users.noreply.github.com> Date: Fri, 28 Nov 2025 17:11:33 -0300 Subject: [PATCH 1/2] Change default value of eth_getStorageAt --- substrate/frame/revive/rpc/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/revive/rpc/src/lib.rs b/substrate/frame/revive/rpc/src/lib.rs index c5cbbcbd7b2ac..b65cd76c6627e 100644 --- a/substrate/frame/revive/rpc/src/lib.rs +++ b/substrate/frame/revive/rpc/src/lib.rs @@ -352,7 +352,7 @@ impl EthRpcServer for EthRpcServerImpl { let hash = self.client.block_hash_for_tag(block).await?; let runtime_api = self.client.runtime_api(hash); let bytes = runtime_api.get_storage(address, storage_slot.to_big_endian()).await?; - Ok(bytes.unwrap_or_default().into()) + Ok(bytes.unwrap_or([0u8; 32].into()).into()) } async fn get_transaction_by_block_hash_and_index( From 16393d8442ba18a9fa2b8368527941792524f365 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Nov 2025 17:30:12 +0000 Subject: [PATCH 2/2] Update from github-actions[bot] running command 'prdoc --audience runtime_dev --bump patch' --- prdoc/pr_10471.prdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 prdoc/pr_10471.prdoc diff --git a/prdoc/pr_10471.prdoc b/prdoc/pr_10471.prdoc new file mode 100644 index 0000000000000..9470a61027bc3 --- /dev/null +++ b/prdoc/pr_10471.prdoc @@ -0,0 +1,10 @@ +title: '[Revive] Change default value of eth_getStorageAt' +doc: +- audience: Runtime Dev + description: |- + Closes https://github.com/paritytech/contract-issues/issues/230 + + With this change `eth_getStorageAt` of the eth rpc always returns a 32 byte array. If the storage slot has never been written before, it returns the 32 byte zero value as the default value. Before that it was the empty array. +crates: +- name: pallet-revive-eth-rpc + bump: patch