Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computed blockhash differs from testnet/mainnet #346

Open
uF4No opened this issue Sep 17, 2024 · 0 comments
Open

Computed blockhash differs from testnet/mainnet #346

uF4No opened this issue Sep 17, 2024 · 0 comments
Labels
bug 🐛 Something isn't working medium 🚩 Indicates moderately difficult item p1 🟠 Indicates high priority item

Comments

@uF4No
Copy link

uF4No commented Sep 17, 2024

🐛 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 accessing blockshash(blocknumber) in Solidity and compare its result with the hash returned by the RPC getBlock as they're different.

🔄 Reproduction Steps

  1. Clone https://github.com/desfero/blockhash-zksync-repro/
  2. Install deps
  3. Configure a testnet PK in the .env file.
  4. Run test vs testnet with npx hardhat test --network zkSyncSepoliaTestnet. Runs ok.
  5. Change PK for one of the rich era-test-node wallets
  6. Run test vs era-test-node with 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

  • Rust version: rustc 1.77.2 (25ef9e3d8 2024-04-09)
  • Operating System & Version: MacOS Sonoma 14.4.1
  • Other relevant environment details: era_test_node 0.1.0-alpha.27

📋 Additional Context

N/A

📎 Log Output

Paste any relevant log output here.
@MexicanAce MexicanAce added bug 🐛 Something isn't working p1 🟠 Indicates high priority item medium 🚩 Indicates moderately difficult item labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working medium 🚩 Indicates moderately difficult item p1 🟠 Indicates high priority item
Projects
None yet
Development

No branches or pull requests

2 participants