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

Convert e2e tmpnet #1249

Merged
merged 51 commits into from
Aug 13, 2024
Merged

Convert e2e tmpnet #1249

merged 51 commits into from
Aug 13, 2024

Conversation

aaronbuchwald
Copy link
Collaborator

@aaronbuchwald aaronbuchwald commented Aug 5, 2024

This PR migrates from using avalanche-network-runner to tmpnet for the existing e2e tests and run script to start a local network w/ MorpheusVM.

This enables starting a network running tmpnet w/ the existing run script:

./scripts/run.sh
   wrote chain configuration for subnet "morpheusvm"
  Re-enabling sybil protection for NodeID-3uBx1B7jaK8T3XKPLw8zxEDSzpvyTThmy
  Restarting bootstrap node NodeID-3uBx1B7jaK8T3XKPLw8zxEDSzpvyTThmy
  Started node "NodeID-3uBx1B7jaK8T3XKPLw8zxEDSzpvyTThmy"
  Starting remaining nodes...
  Started node "NodeID-HAAaGYwrk6mveDcZfu4mnQVBuLyym2sC4"
  Waiting for nodes to report healthy...

  NodeID-HAAaGYwrk6mveDcZfu4mnQVBuLyym2sC4 is healthy @ http://[::]:50742
  NodeID-3uBx1B7jaK8T3XKPLw8zxEDSzpvyTThmy is healthy @ http://[::]:50720

  Started network /Users/aaronbuchwald/.tmpnet/networks/20240813-112922.386535-morpheusvm-e2e-tests (UUID: b4112031-bc4b-4aae-85f4-3ee23ec7569f)

  Metrics: https://grafana-experimental.avax-dev.network/d/kBQpRdWnk/avalanche-main-dashboard?&var-filter=network_uuid%7C%3D%7Cb4112031-bc4b-4aae-85f4-3ee23ec7569f&var-filter=is_ephemeral_node%7C%3D%7Cfalse&from=1723562969413&to=now
  Successfully started network
  Symlinked /Users/aaronbuchwald/.tmpnet/networks/20240813-112922.386535-morpheusvm-e2e-tests to /Users/aaronbuchwald/.tmpnet/networks/latest_morpheusvm-e2e-tests to enable reuse
  network URIs:  [{NodeID:NodeID-3uBx1B7jaK8T3XKPLw8zxEDSzpvyTThmy URI:http://[::]:50720} {NodeID:NodeID-HAAaGYwrk6mveDcZfu4mnQVBuLyym2sC4 URI:http://[::]:50742}]
  test data server URI:  http://127.0.0.1:50770
[SynchronizedBeforeSuite] PASSED [15.088 seconds]

Devs can also enter the tmpnet directory printed out to view the configuration of the tmpnet and explore the logs produced by the nodes:

cd /Users/aaronbuchwald/.tmpnet/networks/20240813-112922.386535-morpheusvm-e2e-tests
ls

Outputs:

NodeID-3uBx1B7jaK8T3XKPLw8zxEDSzpvyTThmy
NodeID-HAAaGYwrk6mveDcZfu4mnQVBuLyym2sC4
chains
config.json
genesis.json
network.env
subnets
cat NodeID-3uBx1B7jaK8T3XKPLw8zxEDSzpvyTThmy/logs/C.log

will output the logs produced by the given nodeID from the C-Chain.

Devs can stop the tmpnet network using the existing stop script:

./scripts/stop.sh
Running Suite: morpheusvm e2e test suites - /Users/aaronbuchwald/go/src/github.com/ava-labs/hypersdk/examples/morpheusvm/tests/e2e
==================================================================================================================================
Random Seed: 1723563089

Will run 4 of 4 specs
------------------------------
[SynchronizedBeforeSuite] 
/Users/aaronbuchwald/go/src/github.com/ava-labs/hypersdk/examples/morpheusvm/tests/e2e/e2e_test.go:78
  Loaded a network configured at /Users/aaronbuchwald/.tmpnet/networks/20240813-112922.386535-morpheusvm-e2e-tests
  Removing symlink /Users/aaronbuchwald/.tmpnet/networks/latest_morpheusvm-e2e-tests
  Stopping network

Ginkgo ran 1 suite in 686.04225ms
Test Suite Passed

To run the test suite from the MorpheusVM directory, developers can execute the run script with the environment variable MODE=test:

MODE=test ./scripts/run.sh

Additionally, the script now passes in any additional arguments to test execution, so that you can pass in standard ginkgo filtering arguments.

For example, to execute only the GetNetwork e2e test:

 MODE=test ./scripts/run.sh --ginkgo.focus=GetNetwork

@aaronbuchwald
Copy link
Collaborator Author

Depends on ava-labs/avalanchego#3290 to make sure tmpnet passes the subnet config correctly

@aaronbuchwald aaronbuchwald marked this pull request as ready for review August 13, 2024 15:40
@aaronbuchwald aaronbuchwald requested a review from marun August 13, 2024 15:40
factory = auth.NewED25519Factory(priv)

gen := genesis.Default()
gen.WindowTargetUnits = fees.Dimensions{18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615}
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these numbers based off of? They seem weirdly precise

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call out, added a comment here and for MaxBlockUnits

Nodes: nodes,
DefaultFlags: tmpnet.FlagsMap{
config.ProposerVMUseCurrentHeightKey: true,
config.InboundThrottlerVdrAllocSizeKey: 10737418240,
Copy link
Contributor

Choose a reason for hiding this comment

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

Also wondering where these defaults come from

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These come from the existing code. Some of them are arbitrary or determined by iterating to the necessary parameters to make sure AvalancheGo does not overthrottle.

@aaronbuchwald aaronbuchwald enabled auto-merge (squash) August 13, 2024 17:58
gen.MaxBlockUnits = fees.Dimensions{1800000, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615}
// Set WindowTargetUnits to MaxUint64 for all dimensions to iterate full mempool during block building.
gen.WindowTargetUnits = fees.Dimensions{math.MaxUint64, math.MaxUint64, math.MaxUint64, math.MaxUint64, math.MaxUint64}
// Set all lmiits to MaxUint64 to avoid limiting block size for all dimensions except bandwidth. Must limit bandwidth to avoid building
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo on limits

@aaronbuchwald aaronbuchwald merged commit 4a6cafc into main Aug 13, 2024
15 checks passed
@joshua-kim joshua-kim deleted the convert-e2e-tmpnet branch August 13, 2024 18:14
@iFrostizz iFrostizz mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants