Skip to content

EVM precompile#3257

Merged
evgenykuzyakov merged 107 commits into
masterfrom
evm-precompile
Dec 3, 2020
Merged

EVM precompile#3257
evgenykuzyakov merged 107 commits into
masterfrom
evm-precompile

Conversation

@ilblackdragon
Copy link
Copy Markdown
Member

@ilblackdragon ilblackdragon commented Aug 28, 2020

Implements near/NEPs#106

  • PR for Ethereum chain_id
  • Return deterministic errors
  • evm accounts are EVM.
  • Create sub-account from evm are removed and we don't plan to support it originally.
  • Integrate gas usage Evm gas estimation #3299
  • Meta transaction calls are currently disabled
  • Precompile in EVM to call outside to NEAR Moved to separate issue
  • Protocol version upgrade to 42 from which evm accounts activate.
  • Add a check that the evm account doesn't have access keys.

Reviews

  • @bowenwang1996 please review changes around genesis/protocol, so we don't leak this feature accidentally.
  • @nearmax if you want to take a second look at runtime changes.
  • @frol do we need to do something from the RPC/indexer perspective?
  • @ilblackdragon In case you want to take a look as well.

Test plan

  • Set of Solidity contracts that can be run inside EVM (see runtime/near-evm-runner/tests/contracts)
  • Interact with CryptoZombies contract via runtime & RPC test
  • Nightly test that will leverage full e2e tooling to deploy & test a full fledged contract(s) Moved to separate issue
  • http://nayduck.eastus.cloudapp.azure.com:3000/#/run/764

@gitpod-io
Copy link
Copy Markdown

gitpod-io Bot commented Aug 28, 2020

Comment thread test-utils/testlib/Cargo.toml Outdated
Comment thread test-utils/testlib/src/runtime_utils.rs Outdated
Copy link
Copy Markdown
Contributor

@evgenykuzyakov evgenykuzyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should wrap EVM into a thread. So if it panics, we don't crash the node and bring down the chain.

Comment thread runtime/near-evm-runner/src/lib.rs Outdated
Comment thread neard/res/genesis_config.json Outdated
Comment thread runtime/near-evm-runner/Cargo.toml Outdated
Comment thread runtime/near-evm-runner/src/builtins.rs Outdated
Comment thread runtime/near-evm-runner/src/builtins.rs Outdated
Copy link
Copy Markdown
Contributor

@maxzaver maxzaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a surface, looks good. I am not able to do a detailed review right now so I suggest instead of blocking this PR, we merge it to unblock Phase 1 and then we do any additional audit reviews post-factum by me or any other people.

@evgenykuzyakov
Copy link
Copy Markdown
Contributor

we merge it to unblock Phase 1 and then we do any additional audit reviews post-factum by me or any other people.

Yep, that's the plan. It's currently very well guarded with the compilation feature so it shouldn't affect non-nightly protocol

Comment thread neard/src/runtime.rs
Comment thread runtime/near-evm-runner/src/interpreter.rs
Comment thread runtime/near-evm-runner/src/interpreter.rs
Comment thread runtime/near-evm-runner/src/pricer.rs
Comment thread runtime/near-vm-logic/src/gas_counter.rs
Comment thread runtime/near-vm-runner/src/wasmtime_runner.rs Outdated
Copy link
Copy Markdown
Contributor

@olonho olonho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, few nits.

Comment thread core/chain-configs/src/genesis_config.rs Outdated
Copy link
Copy Markdown
Contributor

@willemneal willemneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just small edit

Comment thread runtime/runtime-params-estimator/src/cases.rs Outdated
@evgenykuzyakov evgenykuzyakov merged commit a8172d1 into master Dec 3, 2020
@evgenykuzyakov evgenykuzyakov deleted the evm-precompile branch December 3, 2020 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-EVM Area: Native EVM implementation and support

Projects

None yet

Development

Successfully merging this pull request may close these issues.