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

migrate to tmpnet & latest subnetevm #401

Merged
merged 21 commits into from
Jul 18, 2024
Merged

migrate to tmpnet & latest subnetevm #401

merged 21 commits into from
Jul 18, 2024

Conversation

feuGeneA
Copy link
Contributor

@feuGeneA feuGeneA commented Jun 14, 2024

Why this should be merged

Fixes #310

How this works

Stops using avalanche-network-runner, and uses tmpnet instead.

How this was tested

By getting the existing e2e tests in this repo to pass.

How is this documented

@feuGeneA feuGeneA changed the title migrate to templet / subnetevm 0.6.2 migrate to tmpnet / subnetevm 0.6.2 Jun 14, 2024
@feuGeneA feuGeneA force-pushed the tmpnet branch 3 times, most recently from 7f92e3d to fb516a8 Compare June 19, 2024 02:29
@feuGeneA feuGeneA changed the title migrate to tmpnet / subnetevm 0.6.2 migrate to tmpnet & latest subnetevm Jun 19, 2024
@feuGeneA feuGeneA force-pushed the tmpnet branch 5 times, most recently from 3877d11 to 3500bcc Compare June 26, 2024 21:38
@feuGeneA feuGeneA force-pushed the tmpnet branch 6 times, most recently from ed4fb09 to aa040f2 Compare July 5, 2024 19:43
@feuGeneA feuGeneA force-pushed the tmpnet branch 2 times, most recently from aa040f2 to 5072743 Compare July 5, 2024 20:10
go.mod Outdated
@@ -3,14 +3,13 @@ module github.com/ava-labs/teleporter
go 1.21.12

require (
github.com/ava-labs/avalanchego v1.11.1
github.com/ava-labs/avalanchego v1.11.9-0.20240703222923-9d71967ccbba
Copy link
Contributor Author

Choose a reason for hiding this comment

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

9d719... refers to the latest commit hash (as of this writing) in this PR. We should change this to refer to a released version, once that PR has been merged and released.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably what's blocking the e2e tests running

Copy link
Contributor

Choose a reason for hiding this comment

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

nvm. I was lacking context on the issue being around conflicting dependencies on avalanchego.

Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

I know this is still in draft, but what you have now is looking really good :)

@feuGeneA feuGeneA marked this pull request as ready for review July 8, 2024 16:01
@feuGeneA feuGeneA requested a review from a team as a code owner July 8, 2024 16:01
@@ -22,7 +22,7 @@
"blockGasCostStep": 500000
},
"warpConfig": {
"blockTimestamp": 0
"blockTimestamp": 1719343601

Choose a reason for hiding this comment

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

why do we need to specify a specific warp blocktimestamp, as well as the timestamp value below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was experiencing a hang in the test setup, and @ceyonur said "warp cannot be activated at timestamp = 0...also set genesis timestamp to some non-zero value (a recent timestamp is fine)...it was changed after v0.6.3 when we introduced modifiable network upgrades and fixing a regression with using 0 timestamps in genesis." starting from https://platwizards.slack.com/archives/C075HLQL4BT/p1719327426806459?thread_ts=1718898895.417379&cid=C075HLQL4BT

it looks like this is the original issue as reported: ava-labs/avalanchego#2877, which was fixed by ava-labs/subnet-evm#1136 and included in https://github.com/ava-labs/subnet-evm/releases/tag/v0.6.4

Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

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

One typo and a couple of minor suggestions, which you should feel free to defer. Otherwise LGTM!

@@ -62,6 +79,12 @@ var _ = ginkgo.BeforeSuite(func() {

LocalNetworkInstance.DeployTeleporterRegistryContracts(teleporterContractAddress, fundedKey)
log.Info("Set up ginkgo before suite")

ginkgo.AddReportEntry(
"network directory with has node logs & configs; useful in the case of failures",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"network directory with has node logs & configs; useful in the case of failures",
"network directory with node logs & configs; useful in the case of failures",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in ec99c4d

Comment on lines +433 to +434
n.setSubnetValues(n.tmpnet.GetSubnet("A"))
n.setSubnetValues(n.tmpnet.GetSubnet("B"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily for this PR, but parameterizing LocalNetwork with the number of subnets and their names would make this type more flexible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 05b7a9b


var replaced string = string(templateFileBytes[:])
for _, s := range substitutions {
replaced = strings.Replace(replaced, s.Target, s.Value, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a little odd to generalize the target text replacement in this loop, but not the number of replacements. Since we're only replacing a single value in the genesis, I think it's appropriate to just explicitly call strings.Replace(replaces, "<EVM_CHAIN_ID>", strconv.FormatUint(chainID, 10)) here. Or we can go in the other direction and also generalize the number of replacements by either calling strings.ReplaceAll or putting n in the substitutions struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wrote it this way because I wanted the substitution(s) to be visible right at the beginning of the function, so that the reader doesn't have to dig into the implementation to find out what's being substituted.

I wasn't aware of ReplaceAll, that sounds like what I want. thanks!

addressed in aceb38b

Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

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

LGTM overall, small nit but not a blocker

@@ -90,7 +90,7 @@ func NewLocalNetwork(
Expect(err).Should(BeNil())
warpChainConfigPath := f.Name()

allNodes := slices.Clone(extraNodes) // to be appended w/ subnet validators
allNodes := extraNodes // to be appended w/ subnet validators
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why this change? I understand that we don't need to clone if we won't re-access extraNodes but the nodes themselves are pointers already and therefore light. If for some reason we want to loop through just extraNodes in the future we would get the new expanded slice instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the linter made me do it! :) it gave me some seemingly bogus type checking error that it couldn't infer the output type of slices.Clone, so I just did it a different way. I'm not 100% sure why the linter didn't catch this earlier.

later on in this code, we want to iterate over allNodes, which includes not just extraNodes but also all of the subnet nodes as well. this declaration is me starting to build up the list off all nodes, starting with the extraNodes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah, I understand that practically it's not necessary here just a best practice to not have two slice variables pointing to the same underlying arrays. FWIW I think it would have been solved by declaring var allNodes []*tmpnet.Node beforehand.

@feuGeneA feuGeneA merged commit b872cf1 into main Jul 18, 2024
14 checks passed
feuGeneA added a commit that referenced this pull request Jul 18, 2024
feuGeneA added a commit that referenced this pull request Jul 18, 2024
feuGeneA added a commit that referenced this pull request Jul 18, 2024
@feuGeneA feuGeneA mentioned this pull request Jul 18, 2024
@geoff-vball geoff-vball deleted the tmpnet branch July 24, 2024 14:15
feuGeneA added a commit to ava-labs/avalanche-interchain-token-transfer that referenced this pull request Jul 24, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/teleporter that referenced this pull request Aug 1, 2024
0xchainlover pushed a commit to avalabsorg/avalanche-interchain-token-transfer that referenced this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Update subnet-evm to v0.6.2
6 participants