Commit Graph
15 Commits
Author SHA1 Message Date
zeekay d32e075809 refactor: update to vm v1.0.18, migrate log and metrics packages
- Update vm dependency to v1.0.18
- Remove internal log package in favor of luxfi/log
- Migrate prometheus to gatherer package
2026-01-11 21:38:34 -08:00
zeekay 4b7da04687 Use luxfi/math/math instead of geth/common/math 2026-01-03 17:37:03 -08:00
zeekay b1979b4a02 Update EVM 2025-08-01 01:23:42 +00:00
zeekay 7d8b52af3f Update copyrights properly 2025-07-21 21:10:03 -05:00
zeekay 8da155c1b1 Update imports 2025-07-18 01:55:16 +00:00
Ceyhun OnurandGitHub 1d1c38e9bc bump js dependencies (#1193)
* bump dependencies

* bump node version in CI

* update build script
2024-05-29 13:15:02 +03:00
e7d9cc2f90 Precompile events - Native Minter (#963)
* add equality tests

* regenerate abis

* add extra padding tests

* override network upgrades (#839)

* override network upgrades

* genesis network upgrades defaults

* fix conflicts

* Update plugin/evm/vm.go

* update native minter

* nativeminter nit test changes

* replace fee manager packers

* remove generated abis

* Update precompile/contracts/feemanager/contract.go

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

* fix comments

* add event packing/unpacking to contract template

* add pack event tests to template

* add event precompile bind tests

* nits

* separate event file

* Update accounts/abi/bind/precompilebind/precompile_bind.go

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

* revert set changes

* change event comments

* precompile event for native minter

* fixed NativeMint contract to add event

* faulty packing?

* fixed UT

* cleanups

* add get event gas cost and tests

* nits

* remove unrelated changes

* minimize diff

* add hardhat test

* fix gas in tests

* reorder event log

* add topics to GetLogData

* use interface function for testing logs

* Update contract_test.go

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

* add sender to indexed topics

* Update event.go

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

* unindex the amount in event

* Update contracts/test/contract_native_minter.ts

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

* readd after hook

* add signature topic gas costs

* add assert event func

* Update contracts/test/contract_native_minter.ts

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

* Update precompile/contracts/nativeminter/event.go

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

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
2023-12-21 19:43:26 +03:00
6834da19af Precompile events - Reward Manager (#961)
* add event packing/unpacking to contract template

* add pack event tests to template

* add event precompile bind tests

* nits

* separate event file

* Update accounts/abi/bind/precompilebind/precompile_bind.go

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

* revert set changes

* change event comments

* set reward address precompile events

* added UT

* fixed RewardAddress gas costs

* added precompile logging for allowFeeRecipient

* added UT

* added precompile logging for disable rewards

* address code review comments

* some more fixes

* nit

* consolidated UTs

* refactored UT chainConfig creation + extra UTs

* handle D-fork for logs gas cost

* nit

* add event gas calculation to template

* add event gas costs to reward manager functions

* minor comment fix on template

* fix tests

* fix tests

* nits

* nits

* add hardhat test

* add get event gas cost and tests

* revert unrelated changes

* nits

* remove sender fields from events

* use isDUpgrade func from utils

* reorder event log

* rever reordering

* change event set log order

* add topics to GetLogData

* use interface function for testing logs

* use len instead of zero

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

* add sender to events

* use address

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

* trigger CI

* add signature topic gas costs

* add assert event func

* Update contracts/test/reward_manager.ts

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

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Ceyhun Onur <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
2023-12-21 19:24:17 +03:00
2ba8bcd80e Precompile events allow list (#968)
* add equality tests

* regenerate abis

* add extra padding tests

* override network upgrades (#839)

* override network upgrades

* genesis network upgrades defaults

* fix conflicts

* Update plugin/evm/vm.go

* update native minter

* nativeminter nit test changes

* replace fee manager packers

* remove generated abis

* Update precompile/contracts/feemanager/contract.go

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

* fix comments

* add event packing/unpacking to contract template

* add pack event tests to template

* add event precompile bind tests

* nits

* separate event file

* Update accounts/abi/bind/precompilebind/precompile_bind.go

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

* revert set changes

* change event comments

* wip: log allow list events

* propagated allow list events to other precompiles

* add get event gas cost and tests

* nits

* revert unrelated changes

* add allowlist events

* add topics to GetLogData

* fix dep cycle in tests

* add allowlist hardhat tests

* use len in zero assertion

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

* Update test_allowlist.go

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

* add sender to indexed topics

* Update utils.go

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

* add output names

* add signature topic gas costs

* Update precompile/testutils/test_precompile.go

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

* Update accounts/abi/bind/precompilebind/precompile_event_template.go

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

* fix tests

* fix tests

* return err

* add RoleSet event

* Update contracts/test/contract_deployer_allow_list.ts

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

* Update contracts/test/tx_allow_list.ts

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

* add assert event func

* use hash len

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
2023-12-21 19:05:04 +03:00
485ddc1659 Precompile events - Fee Config (#967)
* add equality tests

* regenerate abis

* add extra padding tests

* override network upgrades (#839)

* override network upgrades

* genesis network upgrades defaults

* fix conflicts

* Update plugin/evm/vm.go

* update native minter

* nativeminter nit test changes

* replace fee manager packers

* remove generated abis

* Update precompile/contracts/feemanager/contract.go

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

* fix comments

* add event packing/unpacking to contract template

* add pack event tests to template

* add event precompile bind tests

* nits

* separate event file

* Update accounts/abi/bind/precompilebind/precompile_bind.go

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

* revert set changes

* change event comments

* added event for setFeeConfig

* added UT

* cleanups

* add get event gas cost and tests

* nits

* revert unrelated changes

* add event

* add hardhat test

* add topics to GetLogData

* use interface function for testing logs

* add sender to indexed topics

* Update contract.go

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

* move gas to above

* Update contracts/test/fee_manager.ts

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

* use existing test

* fix typo

* add signature topic gas costs

* fix tests

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
2023-12-21 15:28:26 +00:00
Ceyhun OnurandGitHub 0607a31ff9 Return message ID (#930)
* fix warp event packing

* add hardhat tests for warp

* remove destination fields from test

* parse from event data

* move setup to beforesuite

* add message id to events + return types

* fix test

* fix comment

* format example warp sol
2023-10-18 11:35:41 +03:00
Ceyhun OnurandGitHub e2c7037d64 add hardhat tests for warp (#935)
* fix warp event packing

* add hardhat tests for warp

* remove destination fields from test

* parse from event data

* move setup to beforesuite

* Revert "move setup to beforesuite"

This reverts commit 59abbf14432d29a6c3a82cfcb3e18badadfcd87b.

* cleanups

* move variables to definition

* remove hex checks

* use mocha conf to increase timeouts
2023-10-11 13:57:30 -07:00
Ceyhun OnurandGitHub a1c23956ad Add manager allowlist role (#801)
* update npm package

* expand allowlist.configure

* add activation func to precompile functions

* move chainconfig to precompileconfig

* use chainconfig in verification

* trim unnecessary changes

* add manager role

* fix tests

* add verify test

* nits

* add mocks

* reviews

* fix linter

* fix benchmarks

* nits

* nits

* fix alow list bind tests & ensure they're being tested (#841)

* simplify can modify check

* fix vm tests

* Add manager allowlist role merge (#850)

* Warp stapling block context (#823)

* Add GetPredicateResults to BlockContext

* Serve predicate results from blockContext

* Allow extra data to extend past DynamicFeeWindow post DUpgrade

* Get vm warp unit tests working

* Bump ANR to intermediate version to fix incompatibility with AvalancheGo

* Add kc to EthKeyChain

* Bump avalanchego dep in scripts for CI

* Add block hash payload support

* Use gomocks for precompileconfig and predicater and re-write CheckPredicates with gomocks

* Use gomock for mock accessible state and block context

* Fix existing warp contract tests with mock block context

* Remove unused mockPredicater impl

* x/warp: add contract execution unit tests

* Update NewEVMBlockContext

* Add AppendExtra to syncervm to fix tests

* x/warp: add unit test for multiple predicate results

* core: add unit test for CheckPredicates insufficient gas

* Update receive warp message test to trace block and assert the expected result

* Fix lint

* Update warp solidity contracts

* Fix block context mocks for bench

* Update precompile/precompileconfig/config.go

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

* Cleanup

* precompile/results: Add predicate results tests + comments

* nits

* precompile/results: omit tx predicate results if empty

* core: add invariant comment to predicate check

* Address PR comments

* Fix unpackWarpMessage and add unit tests

* Rename OriginChainID -> SourceChainID to match ago warp message type

* nits

* x/warp: set public key in warp predicate unit tests

* Update payload format

* Clarify IWarpMessenger verified message return types

* core/state: improve statedb warp specific comments

* Update input param type to uint32 to avoid potential overflow on conversion

* Update GetPredicateStorageSlots arg type to uint32

* warp/payload: add README for payload serialization (#835)

* Fix merge

* x/warp: add unit test for PrimaryNetwork to Subnet predicate verification (#831)

* precompilebind: add ChainConfig with DUpgrade enabled to precompile chain config verify template
2023-09-13 09:56:57 -04:00
aaronbuchwaldandGitHub 18e2ec3f27 contracts: fix tx allow list test func name exmaple -> example (#837) 2023-09-05 09:44:47 -07:00
Ceyhun OnurandGitHub 9b09e62625 Fix contract examples package json (#672)
* rename contract-examples to contracts & fix pack issue

* allow custom CMD to be run on blockchains for e2e tests

* move default hardhat test to utils

* fix comment

* add more comments

* change folder reference
2023-06-16 12:03:30 -04:00