You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a new block is produced, the algorithm used to generate the blockhash is different than the one used in testnet/mainnet. This causes issues when accessing blockshash(blocknumber) in Solidity and compare its result with the hash returned by the RPC getBlock as they're different.
Indeed, era-test-node uses a placeholder block hash computation function that produces different results from zksync-era. My assumption was that this is perhaps not easily observable by users but thanks for proving me wrong that there is actual demand for this.
I think the most sane way to fix this would be to make a significant refactoring of metadata_calculator from core so that it is agnostic to where the data is coming from (it is heavily intertwined with PG connections right now).
Most of the work needs to be done from core side but realistically has to be driven from our side as there is zero demand for having storage-agnostic metadata calculator otherwise
🐛 Bug Report for zkSync Era In-Memory Node
📝 Description
When a new block is produced, the algorithm used to generate the
blockhash
is different than the one used in testnet/mainnet. This causes issues when accessingblockshash(blocknumber)
in Solidity and compare its result with the hash returned by the RPCgetBlock
as they're different.🔄 Reproduction Steps
.env
file.npx hardhat test --network zkSyncSepoliaTestnet
. Runs ok.npx hardhat test --network inMemoryNode
. Test fails🤔 Expected Behavior
Same blockhash in Solidity and RPC for the same block
😯 Current Behavior
Blockhash differs in Solidity and RPC for the same block
🖥️ Environment
📋 Additional Context
N/A
📎 Log Output
The text was updated successfully, but these errors were encountered: