33 Commits
Author SHA1 Message Date
zeekay fc1662afd8 Fix import paths and add missing interface stubs for subnet-evm v0.7.5
- Update imports from luxdefi/node to luxfi/node
- Replace libevm interfaces with direct go-ethereum imports
- Add placeholder interface files for missing dependencies
- Update go.mod to use local luxfi/node path
- Fix merge conflicts in multiple files
- Create stub implementations for missing packages

This allows the project structure to align with v0.7.5 requirements
but the build still needs additional work to be fully functional.
2025-07-04 00:03:10 -04:00
a394a37a79 move warp to precompiles package (#1034)
* move warp to precompiles package

* move warp params to warp package

* use log gas cost from contract package

---------

Co-authored-by: Darioush Jalali <[email protected]>
2024-01-04 22:08:03 +00:00
6308c49540 rename DUpgrade to Durango (#1029)
* rename DUpgrade to Durango

* Update core/evm.go

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

* Update x/warp/contract.go

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

* Update precompile/contracts/nativeminter/contract.go

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

* Update predicate/predicate_bytes.go

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

* Update precompile/precompileconfig/config.go

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

* Update x/warp/config.go

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

* Update x/warp/contract.go

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

* Update x/warp/contract.go

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

---------

Signed-off-by: Darioush Jalali <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
2024-01-04 16:41:57 -05:00
Dhruba BasuandGitHub 6f67474c21 Add TestSnowContext util (#1030) 2023-12-22 23:14:36 +03:00
aaronbuchwaldandGitHub f76018bea4 x/warp: update warp log gas cost to reflect number of topics (#1026) 2023-12-20 15:48:08 +00:00
a16a959e28 add event packing/unpacking to contract template (#949)
* 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

* add get event gas cost and tests

* nits

* add topics to GetLogData

* Update utils.go

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

* add output names

* 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

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
2023-12-18 18:14:43 +00:00
omahsandGitHub 5ae735bd66 Fix typos (#1025)
* fix typo

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

* fix typos

* fix typo

* fix typo

---------

Signed-off-by: omahs <[email protected]>
2023-12-17 19:48:10 -08:00
d1c41afc0e Fix abi get inputs (#1023)
* 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

* readd pack/unpack tests

* add signature tests

* refactor allowlist

* add readt allowlist tests

* refactor modify allowlist functions

* add pack read allowlist output

* fix golangci

* remove unrelated signature tests

* fix reviews

* remove skip len check vars

* add native minter equality tests

* add strict mode to getInputs

* fix nits

* add get fee config output fuzz tests

* disable strict mode by default in warp

* add fee manager fuzz tests

* move tests to another test file

* move pack test to another file

* fix tests

* merge allowlist refactor

* move function name getter to type

* move signatures to unpack test

* move signatures to unpack test

* Update precompile/allowlist/allowlist.go

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

* nits

* unexport test fields

* fix tests

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
2023-12-15 14:24:35 -08:00
bcf1139b3c Replace old packers (#857)
* 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

* readd pack/unpack tests

* add signature tests

* remove skip len check vars

* add native minter equality tests

* add get fee config output fuzz tests

* add fee manager fuzz tests

* move tests to another test file

* move signatures to unpack test

* nits

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
2023-12-15 18:18:43 +00:00
fe4dd6e49f verify single predicate (#960)
* verify single predicate

* simplify returned error

* track indexes for predicates

* don't short cirtcuit predicate err

* Update predicate_check.go

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

* nits for single-predicate-verify (#1012)

* Update x/warp/predicate_test.go

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

* Update x/warp/predicate_test.go

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

* review fixes

* use bitset constructor

* change return type to err in verifypredicate

---------

Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: marun <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
2023-12-05 18:28:43 +03:00
aaronbuchwaldandGitHub 27796c9af9 Cleanup warp related code (#995)
* Cleanup warp related code

* Revert back to pass rules via pointer in handlePrecompileAccept

* goimports

* Remove unused var

* Update signature aggregator new comment

* Update README so it applies to both Coreth and Subnet-EVM
2023-11-28 11:32:21 -05:00
Darioush JalaliandGitHub 7749deb9ac warp: add details to accepted message log (#984) 2023-11-06 12:33:31 -08:00
aaronbuchwaldandGitHub 62d949d042 x/warp: update PredicateGas to require warp message contains a valid payload (#945)
* x/warp: add check for valid payload in PredicateGas

* x/warp: fix typo
2023-10-18 11:04:36 -04: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
7cee35b4b7 Move warp payload to avalanchego (#923)
* Integrating Warp Payload Types into AvalancheGo for Cross-VM Compatibility

This fixes https://github.com/ava-labs/avalanchego/discussions/2050 and https://github.com/ava-labs/avalanchego/pull/2116

* Update types

* Do not update go.sum

* Fixed more type changes from the migration

* Drop the alias `avalancheWarpPayload`

The alias is not longer needed

---------

Co-authored-by: Aaron Buchwald <[email protected]>
2023-10-12 22:45:10 +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
Darioush JalaliandGitHub da48064e63 warp: use bitset in predicate results to encode indexes of failures instead of success (#942)
* warp: use 1 in result bitset for fails

* t.Fatal -> require.NoError
2023-10-06 15:30:29 -04:00
Ceyhun OnurandGitHub 5b96551fce fix warp event packing (#939) 2023-10-05 10:18:57 -04:00
CesarandGitHub eb237bc664 Remove destinationAddress and destinationChainID from Warp Message (#920)
* Remove destinationAddress and destinationChainID from Warp Message

* Use UnpackInput instead of UnpackInputIntoInterface

The generated code now matches the output of generate_procompile.sh script
2023-10-03 15:54:13 -04:00
Ceyhun OnurandGitHub 19a0e5bf99 move predicate package and merge with predicate utils (#907)
* add get predicate result bytes helpers

* move predicate package and merge with predicate utils

* update readme

* refactor imports & utils

* typed errs

* add comment

* fix import name

* fix stutter & same var names as pkg name

* rename functions

* fix reviews

* more rename
2023-10-02 16:55:55 -04:00
Stephen ButtolphandGitHub 72f6f6d377 Invalidate block when missing predicate context (#901)
* Invalidate block when missing predicate context

* Fix tests

* Update core/predicate_check.go
2023-09-27 13:49:25 -04:00
Alberto BenegiamoandGitHub 622369e868 Fixed config type cast (#913)
* fixed config type cast

* some more fixes

* fix template
2023-09-27 10:00:42 -04:00
Alberto BenegiamoandGitHub 8cf4819853 removed code duplication (#912) 2023-09-27 06:42:27 -07:00
Ceyhun OnurandGitHub 43434b5637 verify warp is not activated before dupgrade (#872)
* verify warp is not activated before dupgrade

* Update x/warp/config.go

Signed-off-by: Ceyhun Onur <[email protected]>
2023-09-26 18:26:16 -04:00
Darioush JalaliandGitHub 1b550eeda9 enforce warpIndex is <= MaxInt32 (#876) 2023-09-26 18:12:25 -04:00
aaronbuchwaldandGitHub ae81071be2 x/warp: add warp message handler interface within warp contract (#830)
* 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: add warp msg handler

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

* Update payload format

* Address comments

* x/warp: move warp msg handler to separate file

* 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)

* Update return value of handleWarpMessage to match precompile contract template

* Update remainingGas return value
2023-09-13 09:55:35 -04:00
aaronbuchwaldandGitHub 910f109550 x/warp: add unit test for PrimaryNetwork to Subnet predicate verification (#831) 2023-09-12 13:47:55 -04:00
aaronbuchwaldandGitHub 523dcc272e 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
2023-09-12 13:10:26 -04:00
aaronbuchwaldandGitHub a59c7b4a60 Align on a single predicate type (#813)
* Align on single predicate type

* Revert BlockContext comment change

* Update PredicateContext comment

* Address comments
2023-08-25 15:41:43 -04:00
aaronbuchwaldandGitHub ce59e115b5 add mocks for precompile tests (#812)
* add mocks for precompile tests

* Update compatibility

* Bump AvalancheGo dep to v1.10.9

* Bump ANR dep to be compatible with ago v1.10.9

* revert ConfigurationBlockContext changes
2023-08-25 12:58:05 -04:00
Ceyhun OnurandGitHub d57883fd11 Expand verify (#798)
* move chainconfig to precompileconfig

* use chainconfig in verification
2023-08-18 10:10:10 -04:00
ab102b930b Update warp readme (#765)
* Update warp readme

* Address comments

* Update x/warp/README.md

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

* Update x/warp/README.md

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

* Update x/warp/README.md

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

* Fix typo

---------

Signed-off-by: aaronbuchwald <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
2023-08-16 10:03:36 -04:00
aaronbuchwaldandGitHub 246815e95d Add warp contract implementation (#718)
* Add warp contract implementation

* Cleanup predicate test

* Fix new function signature

* Replace invalid fuzz test with unit test

* Add chain config to enable warp API for warp e2e test

* remove unused var

* Add experimental warning and move warp precompile to x/ package

* fix warning label

* Fix warning

* vm test nits

* Improve sendWarpMessenger sol comment

* more vm warp test nits

* Move warp params into params package

* More vm warp test nits

* Address more PR comments

* Remove triggerTx2

* Add check for expected topics from sendWarpMessage log

* Fix config test

* Fix incorrect replace

* remove unnecessary echo

* Address comments

* Address comments

* Address PR comments

* Improve comments

* Convert [32]byte type to common.Hash

* Add base cost for getVerifiedWarpMessage

* fix require equal type check

* Fix updated awm message format

* Update warp message format

* Move IWarpMessenger.sol to interfaces/

* Add newline to warp genesis

* uncomment assertion

* Fix broken links in README
2023-07-31 10:56:25 -04:00