Commit Graph
165 Commits
Author SHA1 Message Date
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
Ceyhun OnurandGitHub e9c603fd66 remove unnecessary locks (#998) 2023-11-16 22:23:09 +00:00
e77c9c97cc coreth sync: 0.12.4-rc.0 -> 0.12.7 (#975)
* coreth sync: 0.12.4-rc.0 -> 0.12.7

* Review coreth 0.12.7 (#980)

* Apply suggested changes from https://github.com/ava-labs/coreth/pull/381/files

* drop reexec=0

* add txHashes

* bump avalanchego

* remove manager

* fix compat test

* bump version for e2e tests

---------

Co-authored-by: Ceyhun Onur <[email protected]>
2023-11-07 14:35:02 -05:00
Darioush JalaliandGitHub acb8bc67d8 bump avalanchego to v1.10.15 (#988)
* bump avalanchego

* remove manager

* fix compat test

* bump version for e2e tests

* update readme
2023-11-07 13:59:22 -05:00
Darioush JalaliandGitHub 7749deb9ac warp: add details to accepted message log (#984) 2023-11-06 12:33:31 -08:00
Ceyhun OnurandGitHub af1c3c28aa remove extra service registration (#978) 2023-11-01 08:19:56 -07:00
Ceyhun OnurandGitHub 1b6ddf5720 bump avalanchego to v1.10.14 (#971)
* bump avalanchego to v1.10.14

* fix versions in readme

* bump min golang version

* bump anr
2023-10-26 12:42:12 -04:00
aaronbuchwaldandGitHub 06ee6b5a45 predicate: fix predicate bytes incorrect error log (#969)
* predicate: fix predicate bytes incorrect error log

* predicate: add unit test for GetPredicateResultBytes
2023-10-26 12:07:03 +03:00
aaronbuchwaldandGitHub 4510ce9fb9 warp: add block signature handler (#962)
* warp: add block signature handler

* warp/aggregator: handle block/message types in aggregator

* warp/aggregator: refactor aggregator

* tests/warp: update e2e tests

* Fix lint

* cleanup

* add logs to e2e test

* Fix bug

* address comments

* tests/warp: add const for num nodes per subnet
2023-10-23 15:18:10 -04:00
Ceyhun OnurandGitHub a2ba3700ff bump subnet-evm and avalanchego versions (#965) 2023-10-19 20:24:06 +03:00
d3776b236e plugin/evm: update type cast to skip call to Bytes() (#958)
Co-authored-by: Ceyhun Onur <[email protected]>
2023-10-18 13:40:34 +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
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
55189b74ac warp: refactor warp handler stats (#944)
* warp: refactor warp handler stats

* warp: update handler stats var name to signatureRequestDuration

---------

Co-authored-by: Ceyhun Onur <[email protected]>
2023-10-11 16:53:28 +03:00
Ceyhun OnurandGitHub 5b96551fce fix warp event packing (#939) 2023-10-05 10:18:57 -04:00
Dan LaineandGitHub 1b688cc353 Rename network signer (#885)
* remove unused code

* remove signature aggregation job

* appease linter

* remove signature aggregation job

* move all signature aggregeation logic to AggregateSignatures

* nit

* nit

* nit

* add mock and tests

* clean up tests

* nit

* don't autogen SignatureGetter because it requires manual changes because gomock is broken

* nit

* comment

* comments

* lower log level

* re-add todo

* move SIgnatureGetter declaration

* change file name

* nits

* use timer instead of time.After (#888)

* nit

* refactor aggregeateSignatures

* comment nits

* add tests

* remove semantic changes

* use error from avalancheWap; combine functions; nits

* add logs

* typo fix
2023-10-03 19:36:59 -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 af7c2531d6 mark flaky test (#917) 2023-10-03 14:49:29 -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
Dan LaineandGitHub 25ae2dedb9 Signature Aggregation Refactor (#883)
* remove unused code

* remove signature aggregation job

* appease linter

* remove signature aggregation job

* move all signature aggregeation logic to AggregateSignatures

* nit

* nit

* nit

* add mock and tests

* clean up tests

* nit

* don't autogen SignatureGetter because it requires manual changes because gomock is broken

* nit

* comment

* comments

* lower log level

* re-add todo

* nit

* refactor aggregeateSignatures

* comment nits

* add tests

* use error from avalancheWap; combine functions; nits

* add logs

* typo fix
2023-09-29 15:09:54 +03:00
Ceyhun OnurandGitHub eb4ba695ea add get predicate result bytes helpers (#906)
* add get predicate result bytes helpers

* typed errs

* add comment
2023-09-28 17:04:16 +03:00
Alberto BenegiamoandGitHub e4a507c99c Change from parsing predicate bytes to checking they equal expected value (#914)
Signed-off-by: Alberto Benegiamo <[email protected]>
2023-09-27 13:56:02 -04:00
d5adea278b rename WarpAPI to API (#864)
Co-authored-by: aaronbuchwald <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
2023-09-26 09:58:01 -07:00
Ceyhun OnurandGitHub 95817a816e bump versions (#880)
* bump versions

* bump anr
2023-09-20 20:47:36 +03:00
Dan LaineandGitHub 09ebd84b48 pass warpSigner instead of snow context into backend (#869) 2023-09-19 15:37:38 -04:00
318a6fe09d P2p sdk pull gossip (#861)
* Add SDK Router message handling (#316)

Co-authored-by: Stephen Buttolph <[email protected]>

* Fix hanging requests after Shutdown (#326)

* fix requests hanging after shutdown

* fix build

---------

Signed-off-by: Stephen Buttolph <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>

* Update to 1.10.10-rc.2 (#328)

* update to avalanchego 1.10.10-rc.2

* nits

* nit

* Add P2P SDK Pull Gossip (#318)

* add batchsize

* sync changes

* Drop outbound gossip for non vdrs (#862)

* Drop outbound gossip requests for non-validators (#334)

* drop outbound gossip requests for non validators

* nit

* nit

* sync changes

---------

Co-authored-by: Joshua Kim <[email protected]>

---------

Co-authored-by: Joshua Kim <[email protected]>
2023-09-19 15:09:47 -04:00
Ceyhun OnurandGitHub 6e22df3bc5 Add SDK Router message handling (#316) (#858)
* Add SDK Router message handling (#316)

Co-authored-by: Stephen Buttolph <[email protected]>

* revert avago version bump

* Fix hanging requests after Shutdown (#326) (#859)

* Fix hanging requests after Shutdown (#326)

* fix requests hanging after shutdown

* fix build

---------

Signed-off-by: Stephen Buttolph <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>

* Bump avago rc (#860)

* Update to 1.10.10-rc.2 (#328)

* update to avalanchego 1.10.10-rc.2

* nits

* nit

* add batchsize

* increase timeout dynamically

---------

Co-authored-by: Joshua Kim <[email protected]>

---------

---------
2023-09-18 21:24:58 -04:00
Dan LaineandGitHub 0b408c0938 rename WarpBackend to Backend (#863)
* rename WarpBackend to Backend

* rename receiver

* rename receiver
2023-09-18 18:39:02 -04: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 23bc5703da plugin/evm: Add ExampleWarp tests to vm warp unit tests (#836)
* plugin/evm: add ExampleWarp tests to vm warp unit tests

* Update ExampleWarp contract usage

* plugin/evm: update unit test to use different source / destination addresses
2023-09-12 17:53:36 -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
Ceyhun OnurandGitHub 124421fe5d override network upgrades (#839)
* override network upgrades

* genesis network upgrades defaults

* fix conflicts

* Update plugin/evm/vm.go
2023-09-12 11:28:59 -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
aaronbuchwaldandGitHub e99ce82534 Add DUpgrade extra data (#811)
* Add DUpgrade extra data

* consensus/dummy: switch to using default insteaad of fallback case
2023-08-25 12:07:18 -04:00
053609c1f6 remove unnecessary upgrade test (#797)
Co-authored-by: Darioush Jalali <[email protected]>
2023-08-18 11:30:38 -07:00
Ceyhun OnurandGitHub 5ef5e4404d force register js tracer (#791) 2023-08-15 10:40:51 -04:00
Darioush JalaliandGitHub 2de3730d2b warp: Remove versiondb + re-order log processing (#776) 2023-08-15 10:30:37 -04:00
Joshua KimandGitHub 95b268804d Revert "add debug log for dropped pending txs notifications (#783)" (#790)
This reverts commit 8728df5795.
2023-08-14 18:17:24 -04:00
Joshua KimandGitHub 8728df5795 add debug log for dropped pending txs notifications (#783) 2023-08-09 14:58:16 -07:00
aaronbuchwaldandGitHub 0eef0d28e2 Bump avalanchego dep and update version for next release (#770)
* Bump avalanchego dep and update version for next release

* Update cache sizes

* Update flag in run script to replace staking-enabled=false
2023-08-02 15:28:19 -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
aaronbuchwaldandGitHub 2d89a14f35 Bump avalanchego to v1.10.5 and bump Subnet-EVM for v0.5.3 release (#757)
* Bump avalanchego to v1.10.5 and bump Subnet-EVM for v0.5.3 release

* bump anr version to v1.7.1
2023-07-26 12:05:44 -04:00
4721f3ebe2 Sync coreth v0.12.4 rc0 (#694)
* apply diff to rc0

* replace coreth with subnet-evm

* go mod tidy

* remove must commit

* remove apricots

* replace coreth with subnet-evm

* rename banff and cortina

* test memory db

* add dUpgrade

* fix errors

* sync with v0.12.4-rc0

* more diffs

* change templates

* readd preparePredicateSlots

* run goimports

* readd tx allow list check to txpool

* Fix tests

* readd subnet evm check for tests

* fix tests

* add gas limit & coinbase fakers

* Fix timestamp types

* check error from newblockchain

* fix gas limit in simulated genesis

* downgrade ci to go 1.19

* gofmt files

* rebump go to 1.20

* bump anr to latest

* bump anr to latest

* prepare predicate storage slots in Subnet-EVM

* uncomment tests

* change order of airdrop memory cleanup

* add utils import

* Coreth 0.12.4 x apply (#720)

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

* move instruction sets

* revert unpack changes

* reduce diffs

* move genesis verify to vm (#753)

* move genesis verify to vm

* fix comment

* set a correct default from genesis

* fix log

* revert change to vm.go

---------

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

* avoid adding/removing GasLimits in tests (#755)

* move genesis verify to vm

* fix comment

* set a correct default from genesis

* fix log

* revert change to vm.go

* avoid adding/removing GasLimits in tests

* nit

---------

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

---------

Co-authored-by: Darioush Jalali <[email protected]>
2023-07-26 09:45:17 -04:00
AnushaandGitHub 2afc51cbe7 Clean up gossip (#744) 2023-07-19 15:37:55 -07:00
Darioush JalaliandGitHub 170ad2361b precompile accepter should take logIdx (#728)
* precompile accepter should take logIdx

* minimize mock

* copyright yr

* add comments
2023-07-17 20:53:17 -04:00
aaronbuchwaldandGitHub 05182799b9 Add signature aggregation helpers (#711)
* Add signature aggregation helpers

* Fix

* Move WarpQuorumDenominator into new file

* Address comments

* fix var rename

* Improve comments

* Address comments
2023-07-07 14:56:58 -04:00
Ceyhun OnurandGitHub 5402fdf216 Differentiate mandatory/optional Subnet-EVM Network Upgrades (#640)
* remove network upgrades from upgrade configs and enforce them in vm init

* fix tests

* remove unused var

* remove extra shutdown

* copy test chain config when modify

* use SimulatedTestChainConfig for simulated tests

* copy modified test chain config

* add optional upgrades

* Add tests

* fix comments

* use unmarshal in test

* unexport functions

* add commented out test

* add TODO comment
2023-07-03 10:21:03 -04:00
morrisettjohnandGitHub 9332360800 added config setting to prune warpdb (#702)
* added config setting to prune warpdb

* refactored warp prune uint test

* message

* fixed up nits

* fixed nits

* fixed nits

* Update plugin/evm/config.go
2023-06-30 14:38:15 -04:00
aaronbuchwaldandGitHub 15b3dfd5fe Update load test to use ANR for network setup (#579)
* Update load test to use ANR for network setup

* Remove ToWebsocketURI that relies on strings feature added in go1.20

* Update load test to use ENV var from CI if populated

* Move env var logic into NewDefaultANRConfig

* Add init functions and clean up comments

* Remove unnecessary helper

* Remove unneeded cmd

* Cleanup

* Address PR comments

* Move 2 min timeout for SetupNetwork to the start of the function
2023-06-27 14:48:52 -04:00