Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions prdoc/pr_10471.prdoc
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading