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

pallet-evm: move to Frontier (Part I) #206

Merged
merged 90 commits into from
Nov 20, 2020
Merged

pallet-evm: move to Frontier (Part I) #206

merged 90 commits into from
Nov 20, 2020

Conversation

sorpaas
Copy link
Member

@sorpaas sorpaas commented Nov 20, 2020

This adds pallet-evm code to Frontier, preserving all history by using git subtree. Not yet integrated with the rest of the codebase.

shawntabrizi and others added 30 commits November 22, 2019 19:21
* palette -> frame

* PALETTE, Palette -> FRAME

* Move folder pallete -> frame

* Update docs/Structure.adoc

Co-Authored-By: Benjamin Kampmann <[email protected]>

* Update docs/README.adoc

Co-Authored-By: Benjamin Kampmann <[email protected]>

* Update README.adoc
* Adding script for rename, could be applicable for nodes on top of it, too

* add stderr and gitlab ci features

* apply script

* fix now minor details in expected stderr

* Update the Cargo.lock

* fix name: sc-transaction -> sc-tracing

* fix rename in script, too
…(#4261)

* pallet-evm: weight calculation for call/create based on gas provided

* Update frame/evm/src/lib.rs

Co-Authored-By: Niklas Adolfsson <[email protected]>
* primitives/sr-primitives -> primitives/runtime

* update
* primitives/sr-std -> primitives/std

* fix

* fix conflict

* rstd -> sp-std

* git mv

* fix review

* fix merge
* Remove warnings when compiling runtime.

* Remove dispatch::Result imports.

* Add missing imports.

* Fix missing vecs. #4333

* Fix oom function.

* Remove superfluous import.

* More warnings.
* primitives/sr-io -> primitives/io

* fix

* rename

* runtime-io -> sp-io

* git mv

* fix ci

* remove package name

* fix

* fix

* try minimizing diff

* try minimizing diff again

* try minimizing diff again
* Rename: Phase 1.

* Unify codec.

* Fixing: Phase 2

* Fixing: Phase 3.

* Fixing: Phase 4.

* Fixing: Phase 5.

* Fixing: Phase 6.

* Fixing: Phase 7.

* Fixing: Phase 8. Tests

* Fixing: Phase 9. Tests!!!

* Fixing: Phase 10. Moar tests!

* Finally done!

* More fixes.

* Rename primitives:: to sp_core::

* Apply renames in finality-grandpa.

* Fix benches.

* Fix benches 2.

* Revert node-template.

* Fix frame-system in our modules.
* clean up cargo.toml syntax

* bumping versions to 2.0

* bump networking to 0.8

* move consensus down to 0.8

* bump consensus pallets to 0.8.0, too

* Upping babe and aura pallets

* add remaining, missing version definitions

* missed some
* Update assets to `decl_error`

* Update aura to `decl_error`

* Update authority discovery to `decl_error`

* Update collective to `decl_error`

* Update evm to `decl_error!`

* Fix error with replace

* Revert "Update authority discovery to `decl_error`"

This reverts commit 26e8f3c56656963d847e984c6f2c8e1f88014899.

* Revert "Update aura to `decl_error`"

This reverts commit 8f17c44ca8375a4a755710aaab7ad4d9522c4376.

* Update democracy to `decl_error`

* Update finality-tracker to `decl_error`

* Update grandpa to `decl_error`

* `assert` to `ensure` in dispatchable function
…ntId and separate gas price (#4424)

* Default implementation for FeeCalculator and ConvertAccountId and separate gas price

* Styling fixes and some docs addition

* TruncateConvertAccountId -> HashTruncateConvertAccountId

* Fix compile
* Make `decl_error!` errors usable

This pr implements support for returning errors of different pallets in
a pallet. These errors need to be declared with `decl_error!`.

The pr changes the following:

- Each dispatchable function now returns a `DispatchResult` which is an
alias for `Result<(), DispatchError>`.
- `DispatchError` is an enum that has 4 variants:
  - `Other`: For storing string error messages
  - `CannotLookup`: Variant that is returned when something returns a
  `sp_runtime::LookupError`
  - `BadOrigin`: Variant that is returned for any kind of bad origin
  - `Module`: The error of a specific module. Contains the `index`,
  `error` and the `message`. The index is the index of the module in
  `construct_runtime!`. `error` is the index of the error in the error
  enum declared by `decl_error!`. `message` is the message to the error
  variant (this will not be encoded).
- `construct_runtime!` now creates a new struct `ModuleToIndex`. This
struct implements the trait `ModuleToIndex`.
- `frame_system::Trait` has a new associated type: `ModuleToIndex` that
expects the `ModuleToIndex` generated by `construct_runtime!`.
- All error strings returned in any module are being converted now to `DispatchError`.
- `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.

* Fix frame system benchmarks
* modify doublemap syntax

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <[email protected]>

Co-authored-by: Bastian Köcher <[email protected]>
* pass target to PaysFee trait and allow batch call to be free if all its calls are free

* bump version

* fix error
* remove default hasher from decl_storage!

* fix decl_storage declarations
* adding license fields to all crates

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <[email protected]>

Co-authored-by: Bastian Köcher <[email protected]>
* pallet-evm: log created address

* Bump spec_version

* Only emit Created event when ExitReason is Succeed
* pallet-evm: optional nonce parameter

* Consume all gases when nonce mismatches

* Bump node runtime version
* pallet-evm: add support for transaction-level create2

* Bump runtime version

* Switch to FunctionOf for weights
* pallet-evm: refactor duplicate code in call/create/create2

* Bump runtime version
* meaningfull -> meaningful

* initialise -> initialize

* tokans -> tokens

* incentivise -> incentivize

* lenght -> length

* incentivisation -> incentivization

* doesnt't -> doesn't

* overwriten -> overwritten

* lifecycle -> life cycle

* lifecycle -> life cycle

* usefull -> useful

* noone -> no one

* spaming -> spamming

* defered -> deferred

* hieght -> height

* sumation -> summation

* ingore -> ignore

* registed -> registered

* Auxialary -> Auxiliary

* loggin -> logging

* independance -> independence

* trailling -> trailing

* responsability -> responsibility

* trunkated -> truncated

* Weither -> Whether

* informations -> information

* Runtume -> Runtime

* choosen -> chosen

* delcataion -> declaration

* Unchekced -> Unchecked

* defintion -> definition

* scrach -> scratch

* imput -> input

* transfered -> transferred

* endownment -> endowment

* Determinator -> Determiner

* relevent -> relevant

* emited -> emitted

* acocunt -> account

* proprotional -> proportional

* instantiaion -> instantiation

* commited -> committed

* tombstonedead -> tombstone

* uwnrap -> unwrap

* acount -> account

* specialised -> specialized

* existant -> existent

* requried -> required

* Anull -> Annul

* AUTHORITES -> AUTHORITIES

* underyling -> underlying

* recognisable -> recognizable

* Capitalise -> Capitalize

* reportfor -> report for

* hearbeat -> heartbeat

* onlineness -> being online

* creater -> creator

* Bytearray -> Byte array

* Despoit -> Deposit

* substratced -> subtracted

* Curent -> Current

* imbalanes -> imbalances

* countfown -> countdown

* inexisting -> inexistent

* additionaly -> additionally

* substracted -> subtracted

* auxilary -> auxiliary

* parital -> partial

* in't -> isn't

* compatability -> compatibility

* infomation -> information

* etected -> detected

* extrinsiscs -> extrinsics

* reprensentation -> representation

* coonfiguration -> configuration

* primtives -> primitives

* miscelanious -> miscellaneous

* VERISON -> VERSION

* endcoded -> encoded

* Genrates -> Generates

* miliseconds -> milliseconds

* occured -> occurred

* trully -> truely

* truely -> truly

* conjuction -> conjunction

* encouters -> encounters

* customised -> customized

* deterministicly -> deterministically

* finalisation -> finalization

* pluggable -> plugable

* wakeup -> wake-up

* interemdiate -> intermediate

* intepreting -> interpreting

* finalzied -> finalized

* throgh -> through

* extinsic -> extrinsic

* convient -> convenient

* allocater -> allocator

* propagateable -> propagatable

* succesfuly -> successfully

* finalising -> finalizing

* publically -> publicly

* phrasee -> phrase

* substration -> substractions

* substractions -> subtractions

* neccessarily -> necessarily

* Inlucde -> Include

* unefficient -> inefficient

* thay -> they

* funtion -> function

* datastructures -> data structures

* infromation -> information

* propagatable -> propagable

* ecountered -> encountered

* recognise -> recognize

* intergration -> integration

* lastet -> latest

* datatypes -> data types

* datatype -> data type

* Strongarming -> Strong Arming

* avaible -> available

* Commiting -> Committing

* Retreiving -> Retrieving

* shoud -> should

* canonicaliziation -> canonicalization

* comitted -> committed

* clonable -> cloneable

* Uknown -> Unknown

* reponse -> response

* arbitary -> arbitrary

* Capapbilities -> Capabilities

* responsbile -> responsible

* initialisation -> initialization

* cames -> came

* intemediate -> intermediate

* reqeust -> request

* intance -> instance

* explcitly -> explicitly

* neighor -> neighbor

* reolving -> resolving

* untill -> until

* Validte -> Validate

* deserailize -> deserialize

* literaly -> literally

* preceeding -> preceding

* abpve -> above

* chcecked -> checked

* numbet -> number

* Unknow -> Unknown

* halfs -> halves

* gossup -> gossip

* givent -> given

* immediatelly -> immediately

* slicable -> sliceable

* conensus -> consensus

* Mimicks -> Mimics

* acccept -> accept

* serialise -> serialize

* exstrinsics -> extrinsics

* panicks -> panics

* maintaince -> maintenance

* repeatidely -> repeatedly

* anecstor -> ancestor

* becasue -> because

* processer -> processor

* Prunning -> Pruning

* insterested -> interested

* unuseful -> not useful

* yeided -> yielded

* descendfing -> descending

* corresponts -> corresponds

* survivew -> survive

* keps -> keeps

* ligh -> light

* prerequisities -> prerequisites

* positiion -> position

* depedency -> dependency

* extrinisic -> extrinsic

* atomicaly -> atomically

* staticly -> statically

* resul -> result

* timestamb -> timestamp

* Utilites -> Utilities

* ammount -> amount

* pocess -> process

* exteral -> external

* Update client/finality-grandpa/src/tests.rs

* Update primitives/io/src/lib.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update primitives/blockchain/src/lib.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update frame/support/src/weights.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update bin/node/cli/tests/common.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update client/cli/src/params.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update client/executor/common/src/sandbox.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update client/finality-grandpa/src/communication/mod.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update client/state-db/src/pruning.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update frame/contracts/src/tests.rs

Co-Authored-By: joe petrowski <[email protected]>

* Update client/api/src/execution_extensions.rs

* bump impl

* timestamb -> timestamp

Co-authored-by: joe petrowski <[email protected]>
* setting versions to development pre-release

fixing version in dependencies

* unset already released wasm-builder

* do not publish test crates

* adding licenses

* setting homepage metadata

* set repository url
bump version to -alpha.1
* setting first batch of descriptions

* fix what I just broke

* next batch

* and pallets, too

* last batch

* set cargo.lock

* keep'em dev-deps

* bump version to alpha.2
* Bump to alpha.3

* update gitlab-ci
This updates `parity-scale-codec` to `1.2.0`, which includes multiple
performance improvements and a fix that bounds the capacity of a vector
at decoding.
* Assign unique storage names to pallets.

* Bump spec

* Upgrade logic for finality tracker (untested)

* Logic for migrating Identity (untested)

* Logic for migrating transaction-payment

* Fix tests

* Fix `decl_storage` build

* Contract -> Contracts

* Update Cargo.lock

* bump spec

* update migration

* Fix merge error

* Migration for contracts

* Remove serde

* Remove some illegal spaces and Options

* Fix types in identity.

* Minor variable rename

Co-authored-by: Gavin Wood <[email protected]>
* System.BlockHash

* Fix hash

* Introduce K/V iteration in all _concat maps

Also move across:
- System.Account (blake2_128_concat)
- Balances.Locks (twox_64_concat)
- ElectionsPhragmen.VotesOf (twox_64_concat)
- ElectionsPhragmen.StakeOf (twox_64_concat)
- Identity.IdentityOf (twox_64_concat)
- Identity.SubsOf (twox_64_concat)
- Society.Payouts (twox_64_concat)
- Session.NextKeys (twox_64_concat)
- Identity.SuperOf (blake2_128_concat)
- Session.KeyOwner (blake2_128_concat)
- Society.SuspendedCandidates (twox_64_concat)
- Society.SuspendedMembers (twox_64_concat)
- Society.Vouching (twox_64_concat)
- Society.Strikes (twox_64_concat)
- System.EventTopics
- Balances.Account

* Build fixes

* Ensure migration happens in correct order

* Staking.*

* Vesting.* Offences.*

* Democracy.*

* Babe.* Collective.*

* Grandpa.*

* Assets.* Benchmark.* Contracts.* Elections.* Asset.* Nicks.*

Also introduce real account list

* ImOnline.*

* Treasury.*

* Recovery.*

* Final bits.

* Docs

* Fix one test

* Fix test

* All passing except the UI tests

* Remove linked_map part 1

* Remove linked_map

* Some iterator utils for double maps.

* Remove old migrations

* Introduce tombstone for LinkedMap type

* Migration for genesis hash

* Fix build

* Fix hash

* Rename Map is_linked -> unused, keeping backwards compat (#5256)

* Update frame/balances/src/lib.rs

Co-Authored-By: Shawn Tabrizi <[email protected]>

* Update frame/elections/src/lib.rs

Co-Authored-By: Shawn Tabrizi <[email protected]>

* Remove old migration code.

* Update frame/system/src/lib.rs

Co-Authored-By: Shawn Tabrizi <[email protected]>

* Update bin/node/runtime/src/lib.rs

Co-Authored-By: Shawn Tabrizi <[email protected]>

* Fix hash

* fix session migration

* Fix watning

Co-authored-by: Jaco Greeff <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Robert Habermeier <[email protected]>
gavofyork and others added 24 commits July 17, 2020 11:11
* Fixes and tests

* Don't set subs be re-registered.

Also allow subs to de-register themselves and collect the deposit.

Also allow individual registering and removal of subs.

* Make it build

* Update frame/identity/src/lib.rs

Co-authored-by: joe petrowski <[email protected]>

* Tests

* Add benchmarks

* Add some reasonable weights

* Docs

Co-authored-by: joe petrowski <[email protected]>
* More app-friendly event description

* change origin -> owner

* checked all decl_event! and changed decriptions.

* annotated parameter names for remaining events
* Bumping to rc5

* Revert "Bumping to rc5"

This reverts commit 3c6767db3d7f94e164c0f08986085fb98bd883ce.

* Bumping for rc5, correctly this time
* pallet-evm: add support for tuple-based precompile declarations

* Add missing license header

* Switch to use impl_for_tuples

* Remove unnecessary impl for ()
This updates parity-scale-codec{-derive} to prepare for a rustc release
that would otherwise break the derive implementation:
rust-lang/rust#73084
…es (#6743)

* pallet-evm: add builtin support for the four basic Ethereum precompiles

* linear_cost -> ensure_linear_cost to directly return OutOfGas error
* pallet-evm: fix wrong logic in mutate_account_basic

* Add test for mutate account
* pallet-evm: avoid double fee payment

* Only skip fee payment for successful calls
* Bump version

* update test-utils crates to be ready for publishing

* adding changelog

* Adding automaticly generated READMEs

* fixing versions

* another version mishap
* change (ci): docs job optimized; runs every commit; fails on warnings

* change (ci): rename jobs; temporary allow failing

* change (ci): better warnings filtering

* fix (ci): hotfix Docker release

* test (ci): run docs job with flags

* test (ci): pwd fails

* change (ci): pass just //doc dir as an artifact; debug

* change (ci): return to the previous structure; undebug

* change (ci): typo

* rebase on upstream 2

* fix the jobname

* Fix some warnings (#7079)

* Partial fix for transaction priority (#7034)

* Partial fix for priority stuff.

* Small fix

* Fix tests.

* Update frame/transaction-payment/src/lib.rs

Co-authored-by: Tomasz Drwięga <[email protected]>

* Better doc

Co-authored-by: Tomasz Drwięga <[email protected]>

* What happens if we remove wat? (#7056)

* What happens if we remove wat?

* Update Cargo.lock

* Make SlashingSpans Public (#6961)

* Make SlashingSpans Public

Offchain Applications will often need to inspect this type because it is directly used in staking election, thus worthy of being `pub`. Rest of the slashing api can remain private, only this and the `fn last_non_zero_slash()` of `SlashingSpans` are of interest.

* Update frame/staking/src/lib.rs

* client/authority-discovery/src/service: Improve docs (#7059)

* Decrease poll interval (#7063)

* Remove unused code (#7027)

Signed-off-by: Jimmy Chu <[email protected]>

* Disambiguate `BlockNumber` type in `decl_module` (#7061)

* Disambiguate `BlockNumber` type in `decl_module`

* fix `frame-support-tests`

* fix ui tests

* fix trait order

* Implement `FromStr` for `Ss58AddressFormat` (#7068)

* Implement `FromStr` for `Ss58AddressFormat`

* Update primitives/core/src/crypto.rs

Co-authored-by: Shawn Tabrizi <[email protected]>

Co-authored-by: Shawn Tabrizi <[email protected]>

* Set reserved nodes with offchain worker. (#6996)

* add offchain worker api to set reserved nodes.

* new offchain api to get node public key.

* node public key from converter

* refactor set reserved nodes ocw api.

* new ndoe authorization pallet

* remove unnecessary clone and more.

* more

* tests for node authorization pallet

* remove dependency

* fix build

* more tests.

* refactor

* Update primitives/core/src/offchain/testing.rs

Co-authored-by: Tomasz Drwięga <[email protected]>

* Update frame/node-authorization/src/lib.rs

Co-authored-by: Tomasz Drwięga <[email protected]>

* Update frame/node-authorization/src/lib.rs

Co-authored-by: Tomasz Drwięga <[email protected]>

* Update frame/node-authorization/src/lib.rs

Co-authored-by: Tomasz Drwięga <[email protected]>

* format code

* expose NetworkService

* remove NetworkStateInfo in offchain

* replace NodePublicKey with PeerId.

* set max length of peer id.

* clear more

* use BTreeSet for set of peers.

* decode opaque peer id.

* extract NetworkProvider for client offchain.

* use OpaquePeerId in node authorization pallet.

* fix test

* better documentation

* fix test

* doc

* more fix

* Update primitives/core/src/offchain/mod.rs

Co-authored-by: Pierre Krieger <[email protected]>

* Update client/offchain/src/api.rs

Co-authored-by: Pierre Krieger <[email protected]>

* derive serialize and deserialize

Co-authored-by: Tomasz Drwięga <[email protected]>
Co-authored-by: Pierre Krieger <[email protected]>

* Fix some warnings

Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Tomasz Drwięga <[email protected]>
Co-authored-by: Sergei Shulepov <[email protected]>
Co-authored-by: Max Inden <[email protected]>
Co-authored-by: s3krit <[email protected]>
Co-authored-by: Jimmy Chu <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: kaichao <[email protected]>
Co-authored-by: Pierre Krieger <[email protected]>

* Fix more doc errors

* More doc fixes

* Remove subdb to make `rustdoc` happy

* Make the line length check happy

* Fix compilation error

* Another try

* Allow unused

Co-authored-by: Dan Forbes <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Tomasz Drwięga <[email protected]>
Co-authored-by: Sergei Shulepov <[email protected]>
Co-authored-by: Max Inden <[email protected]>
Co-authored-by: s3krit <[email protected]>
Co-authored-by: Jimmy Chu <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: kaichao <[email protected]>
Co-authored-by: Pierre Krieger <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
* WeightInfo for Vesting Pallet

* clean up weight docs

* Update lib.rs

* try to pipe max locks

* Update for new type

* add warning when locks > MaxLocks

* Update lib.rs

* fix compile

* remove aliasing, fix trait def

* Update
* evm: Add executor logs to execute_evm response

* Return logs on estimate gas

* Cleanup
* Re-generate READMEs to fix doc links; set readme field in package manifests

* Re-generate READMEs to fix doc links; set readme field in package manifests

* Re-generate READMEs to fix doc links; set readme field in package manifests

* Re-generate READMEs to fix doc links; set readme field in package manifests

* Revert stuff that shouldn't have been committed

* Revert stuff that shouldn't have been committed

* Fix parent relative link generation

* Manually remove this incorrect link for now.
* Rename `ModuleToIndex` to `PalletRuntimeSetup`

Besides the renaming it also adds support getting the name of a pallet
as configured in the runtime.

* Rename it to `PalletInfo`

* Remove accidentally added files
Tagging the release of substrate 2.0


[ci: skip-checks]
* describe pallet evm

* add license

* write readme into lib.rs

* change some sentence

Co-authored-by: Wei Tang <[email protected]>

* update implementation status

Co-authored-by: Wei Tang <[email protected]>

* update readme according to review

* Update frame/evm/src/lib.rs

* fix line length

Co-authored-by: Wei Tang <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
git-subtree-dir: frame/evm
git-subtree-mainline: 3e7265b
git-subtree-split: 5912d5d
@sorpaas
Copy link
Member Author

sorpaas commented Nov 20, 2020

We're going to use merge commits for this PR.

@sorpaas sorpaas merged commit 4fa2b5f into master Nov 20, 2020
@sorpaas sorpaas deleted the sp-evm-move branch November 20, 2020 15:15
abhijeetbhagat pushed a commit to web3labs/frontier that referenced this pull request Jan 11, 2023
pallet-evm: move to Frontier (Part I)
fairax pushed a commit to UniqueNetwork/unique-frontier that referenced this pull request Dec 8, 2024
* use Cancun config
* feat: support transient storage (EIP-1153)
* Update evm dependency
* Adds a new opcode (MCOPY) for copying memory
* feat: support cancun selfdestruct changes (EIP-6780)
---------

Co-authored-by: Agusrodri <[email protected]>
Co-authored-by: Ahmad Kaouk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.