Skip to content

Deploy uniswap v1 and addLiquidity encounter InvalidJump #11

Open
@CaptainVincent

Description

Reproduce issue in local node

Prepare local chain: https://github.com/ParaState/frontier/

  • Add default accounts with balance into chain spec for testing (used to deploy uniswap contract, erc20 token contract ...etc)

Modify frontier/template/node/src/chain_spec.rs

fn testnet_genesis(
	(...)
	// Alice
	vm_genesis.insert(H160::from_str(&"0x1BbE5edc5Caabf4517e40b766D64c3DEd86822Df").unwrap(), ETHAccount {
		nonce: U256::zero(),
		balance: "0x115eec47f6cf7e35000000".into(), // 21M Ether
		storage: BTreeMap::new(),
		code: [].into(),
	});
	// Bob
	vm_genesis.insert(H160::from_str(&"0x987652e1C2B3B953354A43171063499DCE16dC8f").unwrap(), ETHAccount {
		nonce: U256::zero(),
		balance: "0x115eec47f6cf7e35000000".into(), // 21M Ether
		storage: BTreeMap::new(),
		code: [].into(),
	});
	// Charlie
	vm_genesis.insert(H160::from_str(&"0x9f0764D2027c25aC68F341CA568BC3D51aab57A6").unwrap(), ETHAccount {
		nonce: U256::zero(),
		balance: "0x115eec47f6cf7e35000000".into(), // 21M Ether
		storage: BTreeMap::new(),
		code: [].into(),
	});
	(...)
}
  • Run node
cargo run --release --bin frontier-template-node -- \
  --dev \
  --validator \
  --execution=Native \
  --tmp \
  --unsafe-ws-external \
  --unsafe-rpc-external \
  --rpc-port=8545 \
  --rpc-methods=Unsafe

Test steps

使用 official frontier: https://github.com/paritytech/frontier

使用官方最新的 frontier 961e992, 也有相同的錯誤訊息, 要可以驗證的話除了以上流程, 有以下 4 點要注意

  1. ae1f911 chan id 要配合目前的環境改成 123
  2. c5ddafa block 相關的修正要跟
  3. chain_spec.rs 設定 account 是原來的 pallet_evm::GenesisAccount 而非我們 rename 的 ETHAccount
  4. frontier/frame/ethereum/src/lib.rs, 有擋 gas >= gaslimit, parastate-setup 網頁裡面是直接帶入 gas = gaslimit, 看是要改 UI 或是在這邊判斷式拿掉等於的 case
if transaction.gas_limit >= T::BlockGasLimit::get()

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions