velas / velas-chain

Other
70 stars 35 forks source link

EVM Bridge Issue for private chain - Error: RPC response error -32002: Transaction simulation failed: Blockhash not found #444

Open 0xSiXx opened 1 year ago

0xSiXx commented 1 year ago

Problem

We are trying to setup the native to EVM bridge and keep getting the this response:

Error: RPC response error -32002: Transaction simulation failed: Blockhash not found

When running this command: ./velas evm transfer-to-evm --url http://127.0.0.1:8899 --keypair ../../config/bootstrap-validator/identity.json ETHEREUM_WALLET_ADDRESS AMOUNT_TO_SEND

Below I listed out all of our steps, operating system, and commands utilized as well as the flags utilized. If anyone can help us figure this out that would be great we have been having issues with it for about a week now.

Computer specifications

Steps we run

1. Clone to your computer git clone https://github.com/velas/velas-chain

2. Install dependencies

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup component add rustfmt
rustup update

3. Enter directory and build: cd velas-chain && cargo build --release

4. Build genesis: NDEBUG=1 ./multinode-demo/setup.sh

Output:

Creation time: 2023-04-24T00:43:22+00:00
Cluster type: MainnetBeta
Genesis hash: 7mfKLzajXfL4AiLcSDGNPw52JdabGxvGSNZ3spBRW31Y
Shred version: 4007
Ticks per slot: 64
Hashes per tick: Some(12500)
Target tick duration: 6.25ms
Slots per epoch: 432000
Warmup epochs: enabled
Slots per year: 78892314.984
Inflation { initial: 0.08, terminal: 0.005, taper: 0.15, foundation: 0.05, foundation_term: 7.0, __unused: 0.0 }
Rent { lamports_per_byte_year: 3480, exemption_threshold: 2.0, burn_percent: 50 }
FeeRateGovernor { lamports_per_signature: 9500, target_lamports_per_signature: 10000, target_signatures_per_slot: 20000, min_lamports_per_signature: 5000, max_lamports_per_signature: 100000, burn_percent: 50 }
Capitalization: 35000003.9626412 VLX in 23 accounts
Native instruction processors: []
Rewards pool: {}
EVM chain id: 1234

Error 1 in output [2023-04-24T00:43:22.124909000Z ERROR velas_genesis] EVM root was not found but genesis was compiled withwith_evmfeature error: The argument 'evm-root' wasn't found

Warning in output

   Compiling evm-rpc v0.1.0 (/Users/username/Desktop/Velas/velas-chain/evm-utils/evm-rpc)
warning: unreachable pattern
   --> sdk/src/genesis_config.rs:250:17
    |
250 |                 cluster_type => {
    |                 ^^^^^^^^^^^^
    |
    = note: `#[warn(unreachable_patterns)]` on by default

warning: `solana-sdk` (lib) generated 1 warning

5. Start bootnode: NDEBUG=1 ./multinode-demo/bootstrap-validator.sh

6. Start bridge in new terminal window

cd target/release
export RUST_LOG=info
export rpc=trace
./evm-bridge ../../config/bootstrap-validator/identity.json http://127.0.0.1:8899 127.0.0.1:8545 1234

Output

[2023-04-21T23:50:11Z WARN  evm_bridge] Value of "--min-gas-price" is not set or unable to parse. Default value is: 2100000000
[2023-04-21T23:50:11Z INFO  evm_bridge] EVM chain id 1234
[2023-04-21T23:50:11Z INFO  evm_bridge] Trying to create rpc client with addr: http://127.0.0.1:8899
[2023-04-21T23:50:11Z INFO  evm_bridge] Loading keypair from: ../../config/bootstrap-validator/identity.json
[2023-04-21T23:50:11Z INFO  evm_bridge] Creating mempool...
[2023-04-21T23:50:11Z INFO  evm_bridge] Creating server with: 127.0.0.1:8545
[2023-04-21T23:50:11Z INFO  evm_bridge] Creating websocket server: 127.0.0.1:8546
[2023-04-21T23:50:11Z INFO  parity_ws] Listening for new connections on 127.0.0.1:8546.
[2023-04-21T23:50:11Z INFO  evm_bridge::pool] Running cleaner task...
[2023-04-21T23:50:11Z INFO  evm_bridge::pool] Running signature checker task...
[2023-04-21T23:50:11Z INFO  evm_bridge::pool] Worker checks signatures
[2023-04-21T23:50:11Z INFO  evm_bridge::pool] Running deploy worker task...
[2023-04-21T23:51:11Z INFO  evm_bridge::pool] Worker checks signatures
[2023-04-21T23:52:11Z INFO  evm_bridge::pool] Worker checks signatures

The command to bridge from native to EVM: ./velas evm transfer-to-evm --url http://127.0.0.1:8899 --keypair ../../config/bootstrap-validator/identity.json ETHEREUM_WALLET_ADDRESS AMOUNT_TO_SEND

Note: we replace the Ethereum address with one created on MetaMask and the amount to send is typically set to 5.

Error message when trying to send tokens from native to the EVM Error: RPC response error -32002: Transaction simulation failed: Blockhash not found

Configurations

EVM side of the chain configuration:

[2023-04-21T23:50:11Z INFO  evm_bridge] EVM chain id 1234
[2023-04-21T23:50:11Z INFO  evm_bridge] Trying to create rpc client with addr: http://127.0.0.1:8899
[2023-04-21T23:50:11Z INFO  evm_bridge] Loading keypair from: ../../config/bootstrap-validator/identity.json
[2023-04-21T23:50:11Z INFO  evm_bridge] Creating mempool...
[2023-04-21T23:50:11Z INFO  evm_bridge] Creating server with: 127.0.0.1:8545
[2023-04-21T23:50:11Z INFO  evm_bridge] Creating websocket server: 127.0.0.1:8546
[2023-04-21T23:50:11Z INFO  parity_ws] Listening for new connections on 127.0.0.1:8546.

Node Configuration

Command

cd target/release
./velas config get

Output

Config File: /Users/username/.config/velas-chain/cli/config.yml
RPC URL: https://rpc-main-1.test.network/rpc 
WebSocket URL: wss://rpc-main-1.test.network/rpc (computed)
Keypair Path: /Users/username/.config/velas-chain/id.json 
Commitment: confirmed