Skip to content

Conversation

@darioush
Copy link

@darioush darioush commented Jan 9, 2025

Why this should be merged

Supersedes #1401

How this works

Continues libevm development by referencing a version of avalanchego without cyclical imports to avoid initializing libevm incorrectly from wallet & e2e tests.

In this phase of the refactoring, subnet-evm uses the upstream statedb & trie_prefetching mechanism.

Additional avalanchego changes: ava-labs/avalanchego#3645

New changes are commit 28942af and after

How this was tested

CI

Need to be documented?

No

Need to update RELEASES.md?

No

Darioush Jalali and others added 30 commits November 6, 2024 13:37
* add regression test

* remove shared memory from accept and precompile interface

* Update plugin/evm/vm_test.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* revert changes to test helper

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
* add validator state

* add pausable uptime manager

* remove stuttering name

* rename state listener

* add uptime tracking to VM

* remove unused param

* add wg for update validators

* update state before network shutdown

* restart bootstrapping status in test

* add get validator to state

* rename uptime to validator

* fix mock state

* tests

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* use update enum

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* respond to comments

* update avalanchego dep branch

* reviews

* reword errs

* fix test changes

* fix upgrades after deactivating latest in context

* use test branch from avalanchego

* use branch commit for ava version

* update e2e ava version

* update avago dep

* remove extra line...

* export struct

* reviews

* conflict fix

* custom err msg

* add listener mock

* bump avago test branch

* remove config

* remove api changes

* use non-version db for validatorsDB

* remove errs from resume and pause

* check after stopping

* use expectedTime in tests

* reviews

* fix len

* remove log

* use interfaces from pkgs

* improve comments

* new fields and refactorings

* fix linter

* clarify comments

* update comment

* bump to poc branch

* reviews

* update comment

* update to avago master

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
* add validator state

* add pausable uptime manager

* remove stuttering name

* rename state listener

* add uptime tracking to VM

* remove unused param

* add wg for update validators

* update state before network shutdown

* restart bootstrapping status in test

* add get validator to state

* rename uptime to validator

* fix mock state

* tests

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* use update enum

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* respond to comments

* update avalanchego dep branch

* reviews

* reword errs

* fix test changes

* fix upgrades after deactivating latest in context

* use test branch from avalanchego

* use branch commit for ava version

* update e2e ava version

* update avago dep

* remove extra line...

* export struct

* reviews

* conflict fix

* custom err msg

* add listener mock

* bump avago test branch

* remove config

* remove api changes

* Revert "remove api changes"

This reverts commit 8ef763f.

* use non-version db for validatorsDB

* remove errs from resume and pause

* check after stopping

* use expectedTime in tests

* reviews

* Update plugin/evm/vm.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* fix len

* remove log

* disable validators api by default

* use interfaces from pkgs

* improve comments

* new fields and refactorings

* add new fields

* fix linter

* clarify comments

* update comment

* bump to poc branch

* enable validators API by default

* reviews

* update comment

* update to avago master

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
* Bump avalanchego to master

* always sign uptime messages (testing branch)

* nits

* cleanup

* assign to correct `err`

* fix handler

* move ValidatorUptime type to subnet-evm

* disable always signing

* implement on the type itself

* remove unneeded code

* fix ut

* add validator state

* add pausable uptime manager

* remove stuttering name

* rename state listener

* add uptime tracking to VM

* remove unused param

* add wg for update validators

* update state before network shutdown

* restart bootstrapping status in test

* add get validator to state

* rename uptime to validator

* fix mock state

* tests

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* use update enum

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* Update plugin/evm/validators/state.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* respond to comments

* update avalanchego dep branch

* reviews

* reword errs

* fix test changes

* fix upgrades after deactivating latest in context

* use test branch from avalanchego

* use branch commit for ava version

* update e2e ava version

* update avago dep

* remove extra line...

* export struct

* implement acp118 signer and verifier

* avoid revalidating in sign

* refactor warp backend to use acp118 handler

* prune warp db before backend init

* add cache tests

* remove uptime msg type

* add cache test

* fix linter

* add validator uptimes

* bump avago getcurrentvalidators branch

* rename get validator IDs to NodeIDs

* sign uptime warp msg base on uptime calculator

* add tests

* reviews

* conflict fix

* custom err msg

* add listener mock

* bump avago test branch

* remove config

* remove api changes

* Revert "remove api changes"

This reverts commit 8ef763f.

* remove wrapped cache

* use non-version db for validatorsDB

* remove errs from resume and pause

* check after stopping

* use expectedTime in tests

* reviews

* Update plugin/evm/vm.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* fix len

* fix tests

* update avago branch

* use ctx from utils

* add empty check for source address

* nits

* remove log

* disable validators api by default

* fix test context

* use interfaces from pkgs

* improve comments

* Uptime validation nits (#1378)

* add uptime warp example

* remove log

* nit unused interface

* add weight and isSov as fields

* use validator struct in AddValidator

* add comments to example file

* fix test

* add new fields to tests

---------

Signed-off-by: Ceyhun Onur <[email protected]>

* Update plugin/evm/validators/state.go

Co-authored-by: Michael Kaplan <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* pass locker

* rename addresscall verifier fn

* new fields and refactorings

* add new fields

* merge nits

* fix linter

* clarify comments

* update comment

* remove getnodeID

* bump to poc branch

* enable validators API by default

* reviews

* reviews

* update comment

* update to avago master

* revert test change

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: Michael Kaplan <[email protected]>
* fix start timestamp

* add client
* add db inspect

* Update plugin/evm/database.go

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* reduce db code from vm

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: Michael Kaplan <[email protected]>
* fix start timestamp

* add client

* rename sov to l1validator
* fix start timestamp

* add client

* rename sov to l1validator

* bump avago to v1.11.13-rc.1

* update compatibility
* use nodeID filter and uptimePerc

* add uptime seconds
Dimitrolito and others added 17 commits December 12, 2024 11:13
* typos README.md

Signed-off-by: Dmytrol <[email protected]>

* typos README.md

Signed-off-by: Dmytrol <[email protected]>

---------

Signed-off-by: Dmytrol <[email protected]>
Co-authored-by: Ceyhun Onur <[email protected]>
* bump avalanchego to master (updates x/crypto)

* fix

* Encapsulate Signer (#693)

* Remove the bls dependency
---------
Co-authored-by: Darioush Jalali <[email protected]>

* bump to v1.12.1

---------

Co-authored-by: Richard Pringle <[email protected]>
* add validators pkg readme

* Apply suggestions from code review

Co-authored-by: Meaghan FitzGerald <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* Apply suggestions from code review

Co-authored-by: Meaghan FitzGerald <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* Apply suggestions from code review

Co-authored-by: Meaghan FitzGerald <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* nits

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]>
* add multiatch docker build to support arm

* fix build img id

* Update .github/workflows/publish_docker.yml

Co-authored-by: Quentin McGaw <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* Update .github/workflows/publish_docker.yml

Co-authored-by: Quentin McGaw <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>

* fix vm id

* remove debug echo

* revert format change

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Quentin McGaw <[email protected]>
- Localized mockgen commands in the package where they are needed
- Generate mocks from your IDE directly
- Platform independent way of generating mocks
- Check automatically mocks are kept up to date with their matching interfaces
- Check automatically mocks all have a matching source controlled generation command
- Remove license headers for generated mocks
- Generating mocks section added in contributing document
- Use same mockgen version as specified in go.mod
* fix test generator (#724)

* add go mod tidy check
@darioush darioush changed the title Use libevm statedb continued Use libevm statedb (aka phase 2) Jan 9, 2025
@darioush darioush changed the title Use libevm statedb (aka phase 2) Use libevm statedb Jan 9, 2025
@darioush darioush marked this pull request as ready for review January 9, 2025 22:27
@darioush darioush requested review from a team and ceyonur as code owners January 9, 2025 22:27
@darioush darioush changed the title Use libevm statedb libevm phase 2: Use libevm statedb from upstream Jan 9, 2025
Copy link
Collaborator

@ceyonur ceyonur left a comment

Choose a reason for hiding this comment

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

lgtm

@darioush darioush merged commit 4b8f1dc into libevm Jan 13, 2025
11 checks passed
@darioush darioush deleted the use-libevm-statedb-continued branch January 13, 2025 15:45
github-merge-queue bot pushed a commit that referenced this pull request Dec 2, 2025
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.

8 participants