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

test: v3 e2e upgrade #3910

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open

test: v3 e2e upgrade #3910

wants to merge 33 commits into from

Conversation

cmwaters
Copy link
Contributor

@cmwaters cmwaters commented Sep 25, 2024

Closes #3772
Opens #3947

Testing

make test-e2e MajorUpgradeToV3
test-e2e2024/10/08 22:36:00 --- ✅ PASS: MajorUpgradeToV3

@rootulp rootulp self-assigned this Sep 30, 2024
@rootulp
Copy link
Collaborator

rootulp commented Sep 30, 2024

$ make test-e2e MajorUpgradeToV3
--> Running end to end tests
go run ./test/e2e MajorUpgradeToV3
test-e2e2024/09/30 10:24:36 === RUN MajorUpgradeToV3
test-e2e2024/09/30 10:24:36 Creating testnet
INFO[2024-09-30T10:24:36-04:00]log/logger.go:41 Current log level                             env_log_level=LOG_LEVEL log_level=info
ERRO[2024-09-30T10:24:41-04:00]traefik/traefik.go:355 Failed to discover Traefik API resources      error="the server could not find the requested resource"
2024/09/30 10:24:41 failed to create testnet: traefik API is not available
exit status 1
make: *** [test-e2e] Error 1

@evan-forbes @mojtaba-esk have either of you hit this?

@mojtaba-esk
Copy link
Member

$ make test-e2e MajorUpgradeToV3
--> Running end to end tests
go run ./test/e2e MajorUpgradeToV3
test-e2e2024/09/30 10:24:36 === RUN MajorUpgradeToV3
test-e2e2024/09/30 10:24:36 Creating testnet
INFO[2024-09-30T10:24:36-04:00]log/logger.go:41 Current log level                             env_log_level=LOG_LEVEL log_level=info
ERRO[2024-09-30T10:24:41-04:00]traefik/traefik.go:355 Failed to discover Traefik API resources      error="the server could not find the requested resource"
2024/09/30 10:24:41 failed to create testnet: traefik API is not available
exit status 1
make: *** [test-e2e] Error 1

@evan-forbes @mojtaba-esk have either of you hit this?

yes traefik is not installed on your cluster, ask @celestiaorg/devops team to install it on your target cluster.

@rootulp
Copy link
Collaborator

rootulp commented Sep 30, 2024

Sysrex added traefik API to the Robusta cluster so this is now unblocked. The test hangs for me though:

$ make test-e2e MajorUpgradeToV3
--> Running end to end tests
go run ./test/e2e MajorUpgradeToV3
test-e2e2024/09/30 13:53:39 === RUN MajorUpgradeToV3
test-e2e2024/09/30 13:53:39 Creating testnet
INFO[2024-09-30T13:53:39-04:00]log/logger.go:41 Current log level                             env_log_level=LOG_LEVEL log_level=info
{"level":"info","scope":"runmajorupgradetov3-20240930-135339","time":"2024-09-30T13:54:04-04:00","message":"Knuu initialized"}
test-e2e2024/09/30 13:54:04 Running major upgrade to v3 test version ef37dcd
test-e2e2024/09/30 13:54:04 Creating genesis nodes
test-e2e2024/09/30 13:54:04 Creating txsim
{"level":"info","name":"txsim","directory":"/var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/txsim","time":"2024-09-30T13:54:06-04:00","message":"txsim keyring directory created"}
{"level":"info","name":"txsim","pk":"PubKeySecp256k1{0300454F0C8C5CBE6ADBFF78C2CAC1AB432041A42FA29DB24510C7A15EFA9D32B2}","time":"2024-09-30T13:54:06-04:00","message":"txsim account created and added to genesis"}
{"level":"info","name":"txsim","image":"ghcr.io/celestiaorg/txsim:ef37dcd","args":"--key-path /home/celestia --grpc-endpoint 10.45.255.174:9090 --poll-time 1s --seed 42 --upgrade-schedule 20:3","time":"2024-09-30T13:54:06-04:00","message":"created tx client"}
test-e2e2024/09/30 13:54:06 Setting up testnet
{"level":"info","name":"val0","directory":"/var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/val0","time":"2024-09-30T13:54:06-04:00","message":"Creating validator's config and data directories"}
{"level":"info","name":"val1","directory":"/var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/val1","time":"2024-09-30T13:54:06-04:00","message":"Creating validator's config and data directories"}
{"level":"info","name":"val2","directory":"/var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/val2","time":"2024-09-30T13:54:06-04:00","message":"Creating validator's config and data directories"}
{"level":"info","name":"val3","directory":"/var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/val3","time":"2024-09-30T13:54:06-04:00","message":"Creating validator's config and data directories"}
test-e2e2024/09/30 13:54:06 Starting testnet
{"level":"info","time":"2024-09-30T13:54:11-04:00","message":"create endpoint proxies for genesis nodes"}
{"level":"info","name":"val0","version":"ef37dcd","time":"2024-09-30T13:54:20-04:00","message":"started and ports forwarded"}
{"level":"info","name":"val1","version":"ef37dcd","time":"2024-09-30T13:54:25-04:00","message":"started and ports forwarded"}
{"level":"info","name":"val2","version":"ef37dcd","time":"2024-09-30T13:54:31-04:00","message":"started and ports forwarded"}
{"level":"info","name":"val3","version":"ef37dcd","time":"2024-09-30T13:54:37-04:00","message":"started and ports forwarded"}
{"level":"info","time":"2024-09-30T13:54:37-04:00","message":"waiting for genesis nodes to sync"}
{"level":"info","name":"val0","time":"2024-09-30T13:54:37-04:00","message":"waiting for node to sync"}
{"level":"debug","RPC Address":"http://151.115.14.57:80/val0-f0257b5f-26657","time":"2024-09-30T13:54:37-04:00","message":"Creating HTTP client for node"}
{"level":"info","attempts":0,"name":"val0","time":"2024-09-30T13:54:37-04:00","message":"node has synced"}
{"level":"info","name":"val1","time":"2024-09-30T13:54:37-04:00","message":"waiting for node to sync"}
{"level":"debug","RPC Address":"http://151.115.14.57:80/val1-4060741b-26657","time":"2024-09-30T13:54:37-04:00","message":"Creating HTTP client for node"}
{"level":"info","attempts":0,"name":"val1","time":"2024-09-30T13:54:38-04:00","message":"node has synced"}
{"level":"info","name":"val2","time":"2024-09-30T13:54:38-04:00","message":"waiting for node to sync"}
{"level":"debug","RPC Address":"http://151.115.14.57:80/val2-c4614da0-26657","time":"2024-09-30T13:54:38-04:00","message":"Creating HTTP client for node"}
{"level":"info","attempts":0,"name":"val2","time":"2024-09-30T13:54:38-04:00","message":"node has synced"}
{"level":"info","name":"val3","time":"2024-09-30T13:54:38-04:00","message":"waiting for node to sync"}
{"level":"debug","RPC Address":"http://151.115.14.57:80/val3-b221ba4c-26657","time":"2024-09-30T13:54:38-04:00","message":"Creating HTTP client for node"}
{"level":"info","name":"val3","attempt":0,"time":"2024-09-30T13:54:38-04:00","message":"node is not synced yet, waiting..."}
{"level":"info","name":"val3","attempt":1,"time":"2024-09-30T13:54:38-04:00","message":"node is not synced yet, waiting..."}
{"level":"info","attempts":2,"name":"val3","time":"2024-09-30T13:54:39-04:00","message":"node has synced"}
{"level":"info","name":"txsim","time":"2024-09-30T13:54:40-04:00","message":"txsim started"}
test-e2e2024/09/30 14:31:30 waiting for upgrade
{"level":"debug","RPC Address":"http://151.115.14.57:80/val0-f0257b5f-26657","time":"2024-09-30T14:31:30-04:00","message":"Creating HTTP client for node"}
height 1669
height 1671
height 1674
height 1676
height 1678
height 1680
height 1683
height 1685
height 1687
height 1690
height 1692
height 1694
height 1696
height 1699
height 1701
height 1703
height 1705
height 1708
height 1710
test-e2e2024/09/30 14:32:30 --- ERROR MajorUpgradeToV3: failed to upgrade to v3, last height: 1710
exit status 1
make: *** [test-e2e] Error 1

Update: it didn't hang, it just took forever to complete.

@mojtaba-esk
Copy link
Member

Can we please merge this PR after merging #3911 as it has some updates to bump to knuu v0.16.1 ?
@cmwaters @rootulp

@rootulp
Copy link
Collaborator

rootulp commented Oct 1, 2024

Sure! This PR isn't ready and #3911 is ready.

@cmwaters
Copy link
Contributor Author

cmwaters commented Oct 1, 2024

I wasn't aware of this problem when testing. The last problem I experienced with this test is that the txsim wasn't able to execute the MsgSignalVersion. The keyring couldn't find the account of the validator to submit the message. So I was in the process of investigating which keys got added as I had assumed the validator keys would be part of it.

@evan-forbes evan-forbes added WS: V3 3️⃣ item is directly relevant to the v3 hardfork required issue is required to be closed before workstream can be closed labels Oct 2, 2024
@rootulp
Copy link
Collaborator

rootulp commented Oct 3, 2024

Note to self: can see logs for txsim by looking in Lens admin@k8s-knuu-1 and then filtering to namespace like: runmajorupgradetov3-20241003-163612

txsim logs say:

Starting txsim with command:
/bin/txsim --key-path /home/celestia --grpc-endpoint 10.42.89.14:9090 --poll-time 1s --seed 42 --upgrade-schedule 20:3

Error: no sequences specified. Use --stake, --send or --blob
Usage:
  txsim [flags]

Examples:
txsim --key-path /path/to/keyring --grpc-endpoint localhost:9090 --seed 1234 --poll-time 1s --blob 5

Flags:
      --blob int                  number of blob sequences to run
      --blob-amounts string       range of blobs per PFB specified as a single value or a min-max range (e.g., 10 or 5-10). A single value indicates the exact number of blobs to be created. (default "1")
      --blob-share-version int    optionally specify a share version to use for the blob sequences (default -1)
      --blob-sizes string         range of blob sizes to send (default "100-1000")
      --feegrant                  use the feegrant module to pay for fees
      --grpc-endpoint string      grpc endpoint to a running node
  -h, --help                      help for txsim
      --key-mnemonic string       space separated mnemonic for the keyring. The hdpath used is an empty string
      --key-path string           path to the keyring
      --master string             the account name of the master account. Leaving empty will result in using the account with the most funds.
      --poll-time duration        poll time for the transaction client (default 3s)
      --seed int                  seed for the random number generator

I'm considering adding a post-hook so that the validators can submit a signal message instead of requiring txSim to do that.

Update: I don't think this test is using the new txSim binary b/c the --upgrade-schedule flag isn't listed there

@rootulp
Copy link
Collaborator

rootulp commented Oct 4, 2024

Starting txsim with command:
/bin/txsim --key-path /home/celestia --grpc-endpoint 10.44.168.16:9090 --poll-time 1s --seed 42 --blob 1 --blob-amounts 100 --blob-sizes 100-2000 --upgrade-schedule 20:3

upgradeScheduleMap: map[20:3]
{"level":"info","address":"celestia1uu3jgdyvaqdntshffs7e6j3lsqceq5wd5ugfpm","balance":9999998999899600,"time":"2024-10-04T16:59:03Z","message":"set master account"}
{"level":"info","height":17,"address":"celestia1uu3jgdyvaqdntshffs7e6j3lsqceq5wd5ugfpm","msgs":"/cosmos.bank.v1beta1.MsgSend,/cosmos.bank.v1beta1.MsgSend","time":"2024-10-04T16:59:06Z","message":"tx committed"}
{"level":"info","address":"celestia1syvxa98zd5hr25r7qjq8tja9pkd3y4tydhmzjz","balance":1000000000,"time":"2024-10-04T16:59:06Z","message":"initialized account"}
{"level":"info","address":"celestia1wuh7pqua3qm70gs6cqvkk4k49jcuk8gfrk8wt8","balance":100000,"time":"2024-10-04T16:59:06Z","message":"initialized account"}
{"level":"error","error":"key with address celestia1j3wq8c7edndasx460hwfyrm26f26frj6a3fnyp not found: key not found","address":"celestia1j3wq8c7edndasx460hwfyrm26f26frj6a3fnyp","msgs":"/celestia.signal.v1.MsgSignalVersion","time":"2024-10-04T16:59:06Z","message":"tx failed"}
{"level":"error","error":"sequence 1: key with address celestia1j3wq8c7edndasx460hwfyrm26f26frj6a3fnyp not found: key not found [celestiaorg/[email protected]/crypto/keyring/keyring.go:489]","time":"2024-10-04T16:59:06Z","message":"sequence failed"}
{"level":"error","error":"broadcast tx error: share version 1 is not supported in 2. Supported from v3 onwards: unsupported share version","address":"celestia1syvxa98zd5hr25r7qjq8tja9pkd3y4tydhmzjz","blobs count":"100","total byte size of blobs":105956,"time":"2024-10-04T16:59:06Z","message":"tx failed"}
{"level":"error","error":"sequence 0: broadcast tx error: share version 1 is not supported in 2. Supported from v3 onwards: unsupported share version","time":"2024-10-04T16:59:06Z","message":"sequence failed"}
Error: sequence 0: broadcast tx error: share version 1 is not supported in 2. Supported from v3 onwards: unsupported share version

which makes sense because it's trying to send authored blobs before the upgrade from v2 -> v3 happens.

@rootulp
Copy link
Collaborator

rootulp commented Oct 4, 2024

I hit the error @cmwaters described

Starting txsim with command:
/bin/txsim --key-path /home/celestia --grpc-endpoint 10.45.61.218:9090 --poll-time 1s --seed 42 --blob 1 --blob-amounts 100 --blob-sizes 100-2000 --upgrade-schedule 20:3 --blob-share-version 0

upgradeScheduleMap: map[20:3]
{"level":"info","address":"celestia165t58ve34dr9kz4s9tvhtazdj0chkwshzfjwz5","balance":10000000000000000,"time":"2024-10-04T17:04:25Z","message":"set master account"}
{"level":"info","height":14,"address":"celestia165t58ve34dr9kz4s9tvhtazdj0chkwshzfjwz5","msgs":"/cosmos.bank.v1beta1.MsgSend,/cosmos.bank.v1beta1.MsgSend","time":"2024-10-04T17:04:28Z","message":"tx committed"}
{"level":"info","address":"celestia15jhfgfrmuhzj2yszdnr0wgc6vnh57sfktylm4g","balance":1000000000,"time":"2024-10-04T17:04:28Z","message":"initialized account"}
{"level":"info","address":"celestia17mhtmkp8mtp7u75sjs0jsyw7v54xqffc002q93","balance":100000,"time":"2024-10-04T17:04:28Z","message":"initialized account"}
{"level":"error","error":"key with address celestia1aq0pgp009862vskwr59785jnwc327mv6gtv5f5 not found: key not found","address":"celestia1aq0pgp009862vskwr59785jnwc327mv6gtv5f5","msgs":"/celestia.signal.v1.MsgSignalVersion","time":"2024-10-04T17:04:28Z","message":"tx failed"}
{"level":"error","error":"sequence 1: key with address celestia1aq0pgp009862vskwr59785jnwc327mv6gtv5f5 not found: key not found [celestiaorg/[email protected]/crypto/keyring/keyring.go:489]","time":"2024-10-04T17:04:28Z","message":"sequence failed"}

@rootulp
Copy link
Collaborator

rootulp commented Oct 4, 2024

Some debug logs:

Starting txsim with command:
/bin/txsim --key-path /home/celestia --grpc-endpoint 10.35.177.178:9090 --poll-time 1s --seed 42 --blob 1 --blob-amounts 100 --blob-sizes 100-2000 --upgrade-schedule 20:3 --blob-share-version 0

keys: %!v(MISSING)
reccord name: txsim address 4318238D9FF69295A3E86EE6C699457C40773B17
upgradeScheduleMap: map[20:3]
{"level":"info","address":"celestia1gvvz8rvl76fftglgdmnvdx2903q8wwch02sph6","balance":10000000000000000,"time":"2024-10-04T17:35:26Z","message":"set master account"}
{"level":"info","height":22,"address":"celestia1gvvz8rvl76fftglgdmnvdx2903q8wwch02sph6","msgs":"/cosmos.bank.v1beta1.MsgSend,/cosmos.bank.v1beta1.MsgSend","time":"2024-10-04T17:35:29Z","message":"tx committed"}
{"level":"info","address":"celestia1zwkfr4v6scp393y36dvm9tng0rgc3dkdnesu0q","balance":1000000000,"time":"2024-10-04T17:35:29Z","message":"initialized account"}
{"level":"info","address":"celestia1jatkxmcnz825vjd6cm83zk5gdzwe9un0cxnlc7","balance":100000,"time":"2024-10-04T17:35:29Z","message":"initialized account"}
{"level":"error","error":"key with address celestia1h6aj6gp3wz405dvw2jtr9pj6hz0wuzl2w07rlk not found: key not found","address":"celestia1h6aj6gp3wz405dvw2jtr9pj6hz0wuzl2w07rlk","msgs":"/celestia.signal.v1.MsgSignalVersion","time":"2024-10-04T17:35:29Z","message":"tx failed"}
{"level":"error","error":"sequence 1: key with address celestia1h6aj6gp3wz405dvw2jtr9pj6hz0wuzl2w07rlk not found: key not found [celestiaorg/[email protected]/crypto/keyring/keyring.go:489]","time":"2024-10-04T17:35:29Z","message":"sequence failed"}
{"level":"info","height":25,"address":"celestia1zwkfr4v6scp393y36dvm9tng0rgc3dkdnesu0q","blobs count":"100","total byte size of blobs":105956,"time":"2024-10-04T17:35:32Z","message":"tx committed"}

Looks like validator keys don't get added. Validator instances get a volume /home/celestia/.celestia-app. TxSim nodes use a temp directory to add a key.

@rootulp
Copy link
Collaborator

rootulp commented Oct 4, 2024

Still didn't work:

Starting txsim with command:
/bin/txsim --key-path /home/celestia/.celestia-app --grpc-endpoint 10.45.203.36:9090 --poll-time 1s --seed 42 --blob 1 --blob-amounts 100 --blob-sizes 100-2000 --upgrade-schedule 20:3 --blob-share-version 0

keys: {0xc00120e5d0 0xc00121e220 test {[{}] [{}]}}
reccord name: txsim address celestia1vtskfhazquysg58ufc5dq4g5jp9rfd86kdz0fc
upgradeScheduleMap: map[20:3]
{"level":"info","address":"celestia1vtskfhazquysg58ufc5dq4g5jp9rfd86kdz0fc","balance":10000000000000000,"time":"2024-10-04T17:53:41Z","message":"set master account"}
{"level":"info","height":90,"address":"celestia1vtskfhazquysg58ufc5dq4g5jp9rfd86kdz0fc","msgs":"/cosmos.bank.v1beta1.MsgSend,/cosmos.bank.v1beta1.MsgSend","time":"2024-10-04T17:53:44Z","message":"tx committed"}
{"level":"info","address":"celestia1keldxjcxavgztpmjd9yfd9fk0gsdgfded2zhwp","balance":1000000000,"time":"2024-10-04T17:53:44Z","message":"initialized account"}
{"level":"info","address":"celestia10e7r95r7v32l2q7l0rmyww6nse58xyz8mfkyn6","balance":100000,"time":"2024-10-04T17:53:44Z","message":"initialized account"}
{"level":"error","error":"key with address celestia16lnajh2lcrf8crrv3ez7l54pk2tegsgh56dk0a not found: key not found","address":"celestia16lnajh2lcrf8crrv3ez7l54pk2tegsgh56dk0a","msgs":"/celestia.signal.v1.MsgSignalVersion","time":"2024-10-04T17:53:44Z","message":"tx failed"}
{"level":"error","error":"sequence 1: key with address celestia16lnajh2lcrf8crrv3ez7l54pk2tegsgh56dk0a not found: key not found [celestiaorg/[email protected]/crypto/keyring/keyring.go:489]","time":"2024-10-04T17:53:44Z","message":"sequence failed"}

Update: I don't see any logic to copy the keys from the validators to the txSim nodes.

@rootulp rootulp requested review from rach-id and ninabarbakadze and removed request for a team October 7, 2024 03:32
@rootulp
Copy link
Collaborator

rootulp commented Oct 7, 2024

For posterity the two issues I found and fixed were:

  1. txsim didn't have access to the validator keys so I copied them from the genesis keyring to the txsim keyring
  2. the upgrade sequence had a bug where it prematurely submitted the MsgTryUpgrade before all validator signals were submitted

Copy link
Contributor

coderabbitai bot commented Oct 7, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes in this pull request involve the introduction of a new file major_upgrade_v3.go that implements the MajorUpgradeToV3 function, which orchestrates an upgrade process for a test network to version 3 of the Celestia application. Additionally, modifications to the Testnet struct and its methods in test/e2e/testnet/testnet.go include updates to method signatures and enhancements in account management.

Changes

File Path Change Summary
test/e2e/testnet/testnet.go Updated method signatures to include upgradeSchedule and improved account management logic.
test/e2e/major_upgrade_v3.go Added function MajorUpgradeToV3 for managing the upgrade process to version 3 of the application.

Assessment against linked issues

Objective Addressed Explanation
Add an e2e major upgrade test for v3 (#3772) A new test for upgrading to version 3 was created in major_upgrade_v3.go.

Possibly related PRs

Suggested labels

testing, WS: Big Blonks 🔭, warn:api breaking

Suggested reviewers

  • cmwaters
  • staheri14
  • evan-forbes

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 11a01b0 and ae45da4.

📒 Files selected for processing (2)
  • test/e2e/major_upgrade_v3.go (1 hunks)
  • test/e2e/testnet/testnet.go (9 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/major_upgrade_v3.go
🧰 Additional context used
🔇 Additional comments (5)
test/e2e/testnet/testnet.go (5)

33-33: Function New: Addition of chainID and genesisModifiers

The updated function signature for New now includes chainID and genesisModifiers, enhancing the flexibility of the testnet initialization by allowing custom chain IDs and genesis modifications.


113-117: Integration of upgradeSchedule in CreateTxClients

The addition of the upgradeSchedule parameter to CreateTxClients enables scheduling multiple upgrades, improving the testnet's ability to simulate complex upgrade scenarios.


132-143: Improved documentation for CreateTxClient

The detailed parameter descriptions added to the CreateTxClient function enhance code readability and maintainability, adhering to Go's documentation conventions.


146-153: Function CreateTxClient: Inclusion of upgradeSchedule

The function signature update correctly adds upgradeSchedule, preparing the txsim client to handle scheduled upgrades during testing.


478-481: New method Genesis: Accessor for genesis configuration

Adding the Genesis method provides access to the genesis field, facilitating further configurations or inspections of the genesis state as needed.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 11

🧹 Outside diff range and nitpick comments (14)
test/e2e/testnet/key_generator.go (2)

16-20: Consider adding an explanatory comment for using math/rand.

The function correctly initializes the keyGenerator with a seeded random number generator. However, it might be beneficial to add a comment explaining why math/rand is used instead of crypto/rand. This would clarify the intentional use of a deterministic random number generator for testing purposes.

Consider adding a comment like this:

// We use math/rand instead of crypto/rand to ensure deterministic key generation for testing purposes.

22-37: LGTM: Well-implemented Generate method with a minor suggestion.

The Generate method is well-implemented, correctly handling the supported key types and including appropriate error handling. The use of panic for unsupported key types is acceptable in this context.

Consider adding a comment to document that an empty string for keyType defaults to ed25519. This could improve clarity for users of this method. For example:

// Generate creates a private key of the specified type.
// If keyType is an empty string, it defaults to "ed25519".
func (g *keyGenerator) Generate(keyType string) crypto.PrivKey {
    // ... existing implementation ...
}
test/e2e/minor_version_compatibility.go (1)

66-67: LGTM. Consider adding a comment for clarity.

The addition of the upgradeSchedule parameter to the CreateTxClient method call is a good improvement, allowing for future flexibility in upgrade testing.

Consider adding a brief comment explaining the purpose of the upgradeSchedule parameter, especially since it's currently initialized as an empty map. This would improve code readability and maintainability. For example:

+ // Initialize an empty upgrade schedule. This can be populated in the future to test specific upgrade scenarios.
upgradeSchedule := map[int64]uint64{}
test/e2e/major_upgrade_v2.go (1)

55-56: Approve the addition of upgradeSchedule, but suggest improvements

The addition of the upgradeSchedule parameter to CreateTxClient is a good step towards implementing upgrade tests. However, there are a few points to consider:

  1. The upgradeSchedule map is currently empty. Consider populating it with relevant upgrade information for v2 and v3.

  2. The function name MajorUpgradeToV2 suggests this test is for v2, but the PR objectives mention implementing a v3 upgrade test. Consider either:
    a) Renaming this function to MajorUpgradeToV3 if it's meant to test v3 upgrades, or
    b) Creating a new function MajorUpgradeToV3 that builds upon this one for v3 testing.

  3. To fully address the PR objectives, expand this test (or create a new one) to cover v3 upgrades and future signaling-based upgrades. This may involve adding logic to handle different upgrade versions and incorporating signaling mechanisms.

Would you like assistance in implementing these suggestions?

test/e2e/benchmark/benchmark.go (1)

59-68: Improved readability and added upgrade schedule support. LGTM!

The restructuring of the CreateTxClients method call enhances code readability. The addition of the map[int64]uint64{} parameter for the upgrade schedule is a good preparation for future upgrade testing.

Consider adding a comment explaining the purpose of the empty upgrade schedule map for better clarity:

 		b.manifest.TxClientsResource,
 		gRPCEndpoints,
-		map[int64]uint64{}, // upgrade schedule
+		map[int64]uint64{}, // upgrade schedule (empty for now, can be populated for future upgrade tests)
 	)
test/cmd/txsim/cli.go (1)

132-137: LGTM: Enhanced blob sequence creation with share version support.

The changes allow for optional specification of a share version for blob sequences, which is a valuable addition. The condition blobShareVersion >= 0 ensures that the share version is only set when explicitly specified.

Consider adding a check to ensure that blobShareVersion doesn't exceed the maximum allowed value for a uint8. For example:

 if blobShareVersion >= 0 {
+    if blobShareVersion > 255 {
+        return fmt.Errorf("blob share version must be between 0 and 255, got %d", blobShareVersion)
+    }
     sequence.WithShareVersion(uint8(blobShareVersion))
 }

This would prevent potential issues with overflow when converting to uint8.

test/e2e/testnet/node.go (2)

100-107: LGTM: Improved function signature with a suggestion

The reorganization of parameters and the renaming of upgradeHeight to upgradeHeightV2 enhance code clarity and specificity. These changes improve the overall readability of the function signature.

Consider adding a comment to explain the purpose of upgradeHeightV2 for better documentation.


163-164: LGTM: Updated upgrade height condition

The condition has been correctly updated to use the renamed upgradeHeightV2 parameter. This change maintains consistency with the function signature update.

Consider adding a comment to explain the significance of the V2 upgrade and why this condition is necessary.

test/e2e/testnet/txsimNode.go (1)

89-93: Review argument logging for sensitive information

While logging the args array can be helpful for debugging, ensure that it does not contain sensitive information such as secrets or private keys. Currently, the arguments seem safe, but it's good practice to audit logged data for potential security risks.

test/txsim/upgrade.go (1)

83-83: Update comment to reflect 'signalled' instead of 'voted'

The comment refers to validators having voted, but the code now tracks whether validators have signalled. Update the comment for consistency and clarity.

Apply this diff to correct the comment:

-// if all validators have voted, we can now try to upgrade.
+// if all validators have signalled, we can now try to upgrade.
test/e2e/major_upgrade_v3.go (3)

27-29: Replace 'HACKHACK' with standard comment markers.

The use of // HACKHACK: is unconventional and may be confusing to other developers. Consider using standard comment markers like TODO, FIXME, or NOTE to indicate temporary code or important notes.

Update the comment as follows:

// TODO: Use the main branch version after the PR is merged.

31-31: Format the log message for clarity.

Passing multiple arguments to logger.Println will concatenate them with spaces, which might not produce the intended log message structure.

Consider formatting the log message to clearly display the version information:

logger.Println(fmt.Sprintf("Running major upgrade to v3 test, version: %s", version))

Or, if using a structured logger that supports key-value pairs:

logger.Println("Running major upgrade to v3 test", "version", version)

Ensure that the logging library correctly handles key-value pairs if you choose the latter option.


87-87: Use logger.Println instead of fmt.Println for consistency.

Using fmt.Println for logging deviates from the logging pattern used throughout the file. For consistent logging and potentially better log management, use logger.Println.

Update the line to:

logger.Println("height", resp.Header.Height)
test/e2e/testnet/testnet.go (1)

181-182: Use structured logging instead of fmt.Printf

The line fmt.Printf("nodeName %v\n", nodeName) uses standard output for logging, which may not be consistent with the rest of the application's logging strategy. For consistency and better log management, consider using the log package.

Replace with:

log.Info().Str("nodeName", nodeName).Msg("Processing node")
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c713401 and acc95b0.

📒 Files selected for processing (14)
  • pkg/appconsts/global_consts.go (1 hunks)
  • test/cmd/txsim/cli.go (4 hunks)
  • test/e2e/benchmark/benchmark.go (1 hunks)
  • test/e2e/main.go (1 hunks)
  • test/e2e/major_upgrade_v2.go (1 hunks)
  • test/e2e/major_upgrade_v3.go (1 hunks)
  • test/e2e/minor_version_compatibility.go (1 hunks)
  • test/e2e/simple.go (1 hunks)
  • test/e2e/testnet/key_generator.go (1 hunks)
  • test/e2e/testnet/node.go (4 hunks)
  • test/e2e/testnet/testnet.go (8 hunks)
  • test/e2e/testnet/txsimNode.go (3 hunks)
  • test/e2e/testnet/util.go (0 hunks)
  • test/txsim/upgrade.go (2 hunks)
💤 Files with no reviewable changes (1)
  • test/e2e/testnet/util.go
🧰 Additional context used
🔇 Additional comments (19)
test/e2e/testnet/key_generator.go (2)

3-10: LGTM: Imports are appropriate and necessary.

The imported packages are relevant to the functionality of the key generator. No unused imports are present.


12-14: LGTM: keyGenerator struct is well-defined.

The struct is simple and focused, containing only the necessary field for its purpose. Using a custom random number generator allows for deterministic key generation, which is beneficial for testing scenarios.

test/e2e/main.go (2)

Line range hint 1-71: Summary: Successful integration of new test case.

The addition of the "MajorUpgradeToV3" test case to the tests slice is the only change in this file. This modification aligns well with the PR objectives of implementing an e2e upgrade test for v3. The existing structure for running tests, including specific test selection and error handling, remains intact. This change effectively expands the testing capabilities without disrupting the current functionality.

To ensure comprehensive testing, make sure that:

  1. The MajorUpgradeToV3 function is properly implemented in the appropriate file.
  2. Any necessary setup or teardown procedures for this new test are in place.
  3. The new test is included in any relevant CI/CD pipelines or testing scripts.

26-26: LGTM: New test case added correctly.

The addition of the "MajorUpgradeToV3" test case is consistent with the existing structure and follows the pattern of other test cases. This is a good step towards implementing the e2e upgrade test for v3 as outlined in the PR objectives.

To ensure the MajorUpgradeToV3 function is properly defined, please run the following script:

Consider updating any relevant documentation or README files to reflect the addition of this new test case, if not already done.

✅ Verification successful

Verification Successful: MajorUpgradeToV3 function exists.

The MajorUpgradeToV3 function is properly defined in test/e2e/major_upgrade_v3.go, confirming that the new test case integrates correctly with the codebase.

Consider updating any relevant documentation or README files to reflect the addition of this new test case, if not already done.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the MajorUpgradeToV3 function

# Test: Search for the MajorUpgradeToV3 function definition
rg --type go "func MajorUpgradeToV3\(" -A 5

Length of output: 388

test/e2e/simple.go (1)

38-39: LGTM! Verify CreateTxClient usage across the codebase.

The addition of the upgradeSchedule parameter to the CreateTxClient method call is appropriate for implementing upgrade testing capabilities. The empty map is suitable for this simple E2E test where no specific upgrade is scheduled.

To ensure consistency, please verify that all other calls to CreateTxClient in the codebase have been updated with the new parameter. Run the following script to check for any inconsistencies:

✅ Verification successful

Verified: All CreateTxClient usages include the upgradeSchedule parameter.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for inconsistent usage of CreateTxClient across the codebase

# Search for CreateTxClient calls
rg --type go -A 5 'CreateTxClient\('

Length of output: 3556

pkg/appconsts/global_consts.go (1)

33-36: ⚠️ Potential issue

Revert temporary override and implement a configurable solution

The current change overrides DefaultUpgradeHeightDelay with a value of 1 for e2e testing purposes. This approach is risky as it could accidentally be merged into production, potentially causing issues with the upgrade process.

As suggested in a previous review, please consider the following approach:

  1. Revert the temporary override.
  2. Implement a configurable solution using build flags or environment variables.

Here's a potential implementation:

var DefaultUpgradeHeightDelay int64

func init() {
    DefaultUpgradeHeightDelay = 7 * 24 * 60 * 60 / 12 // Default 7-day delay

    if delayStr := os.Getenv("UPGRADE_HEIGHT_DELAY"); delayStr != "" {
        if delay, err := strconv.ParseInt(delayStr, 10, 64); err == nil {
            DefaultUpgradeHeightDelay = delay
        }
    }
}

This approach allows you to easily override the delay for testing purposes without risking accidental merges of test-specific values into production code.

To ensure this constant isn't being overridden elsewhere, run:

#!/bin/bash
# Search for other occurrences of DefaultUpgradeHeightDelay assignment
rg --type go 'DefaultUpgradeHeightDelay\s*=' -g '!pkg/appconsts/global_consts.go'
test/cmd/txsim/cli.go (4)

44-44: LGTM: New variable for blob share version.

The addition of blobShareVersion as a global variable is appropriate for CLI flags and enhances the flexibility of blob sequence configuration.


106-107: LGTM: Updated error message for clarity.

The error message now correctly includes --upgrade-schedule as a valid option, providing users with complete information about available sequence types.


219-219: LGTM: New CLI flag for blob share version.

The addition of the --blob-share-version flag is well-implemented. The default value of -1 aligns with the logic in the blob sequence creation, and the description clearly explains its purpose.


Line range hint 1-270: Overall assessment: Well-implemented enhancements to the transaction simulator.

The changes in this file successfully enhance the functionality of the transaction simulator by allowing more detailed configuration of blob sequences, particularly through the addition of the blob share version feature. These modifications align well with the PR objectives of improving testing capabilities for major upgrades.

Key improvements:

  1. Introduction of the blobShareVersion variable and corresponding CLI flag.
  2. Enhanced blob sequence creation logic to incorporate the share version.
  3. Updated error messages for better user feedback.

The changes are well-implemented, with only a minor suggestion for additional error handling in the blob share version setting. These enhancements contribute positively to the testing framework's robustness and flexibility.

test/e2e/testnet/node.go (3)

62-62: LGTM: Improved method signature

The removal of the trailing comma in the method signature is a good cleanup. It improves code consistency and adheres to Go's syntax conventions.


75-75: LGTM: Improved method signature

Similar to the previous change, the removal of the trailing comma in this method signature enhances code consistency and adheres to Go's syntax conventions.


Line range hint 462-462: Please clarify the change in stake calculation

The Stake field is now set to half of the SelfDelegation amount (n.SelfDelegation / 2). This is a significant change that could affect the validator's voting power and potentially impact network security.

Could you please provide more context on:

  1. The rationale behind this change?
  2. Any potential impacts on the network's security or consensus?
  3. Whether this change is part of a broader update to the staking mechanism?

To assess the impact of this change, let's check for other occurrences of stake calculations in the codebase:

✅ Verification successful

Verified Stake Calculation Update

The modification to set Stake to n.SelfDelegation / 2 is consistent with existing implementations, such as in test/util/genesis/accounts.go, where Stake is set to DefaultInitialBalance / 2 to reserve tokens for fees. This indicates a deliberate strategy to allocate half of the tokens for staking purposes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for stake calculations in Go files
rg --type go 'Stake\s*[:=]' -C 3

Length of output: 1883

test/e2e/testnet/txsimNode.go (1)

69-69: Confirm correct UID for volume ownership

When adding the volume with AddVolumeWithOwner, the UID 10001 is specified. Verify that this UID matches the user inside the txsim container that needs access to the volume. Incorrect ownership may lead to permission issues during runtime.

You can check the UID of the user inside the container by inspecting the Dockerfile or running the following command on a running container:

#!/bin/bash
# Description: Check the UID of the user inside the container.
# Expected: The UID should match the one specified in `AddVolumeWithOwner`.

# Replace <container_name> with the actual container name or ID.
docker exec <container_name> id -u
test/e2e/testnet/testnet.go (5)

476-479: Addition of Genesis() method to Testnet struct

The new method Genesis() provides access to the genesis field of the Testnet struct. This enhances encapsulation and allows other components to access genesis-related data more cleanly.


83-86: Ensure all invocations of CreateGenesisNode use upgradeHeightV2

The parameter upgradeHeight has been renamed to upgradeHeightV2 in the CreateGenesisNode method. Verify that all calls to this method have been updated accordingly to prevent incorrect parameter assignment.

Use the following script to detect any outdated calls:

#!/bin/bash
# Description: Find calls to CreateGenesisNode using the old parameter name

rg --type go 'CreateGenesisNode\([^\)]*upgradeHeight[^\)]*\)'

113-117: Update calls to CreateTxClients with the new upgradeSchedule parameter

The CreateTxClients method now includes an additional parameter upgradeSchedule map[int64]uint64. Ensure that all calls to this method provide the new parameter to maintain expected functionality.

Run the following script to find and review calls to CreateTxClients:

#!/bin/bash
# Description: Find all instances of CreateTxClients and display surrounding lines for context

rg --type go -A 5 'CreateTxClients\('

97-99: Ensure all invocations of CreateGenesisNodes use upgradeHeightV2

The parameter upgradeHeight has been renamed to upgradeHeightV2 in the CreateGenesisNodes method. Verify that all calls to this method have been updated to match the new parameter name.

Use the following script to detect any outdated calls:

#!/bin/bash
# Description: Find calls to CreateGenesisNodes using the old parameter name

rg --type go 'CreateGenesisNodes\([^\)]*upgradeHeight[^\)]*\)'

132-149: Update CreateTxClient method calls with new parameters

The CreateTxClient method signature has changed:

  • sequences is renamed to blobSequences
  • Added a new parameter upgradeSchedule map[int64]uint64

Ensure all calls to CreateTxClient are updated to reflect these changes.

Run the following script to identify outdated calls:

#!/bin/bash
# Description: Find all calls to CreateTxClient and display surrounding lines for context

rg --type go -A 10 'CreateTxClient\('

test/e2e/testnet/txsimNode.go Show resolved Hide resolved
test/e2e/testnet/txsimNode.go Show resolved Hide resolved
Comment on lines +31 to +42
name string,
version string,
endpoint string,
seed int64,
sequences int,
blobSequences int,
blobRange string,
blobsPerSeq int,
pollTime int,
resources Resources,
volumePath string,
knuu *knuu.Knuu,
upgradeSchedule map[int64]uint64,
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Update Required for CreateTxClient Invocation in testnet.go

  • test/e2e/testnet/testnet.go:117 uses the outdated parameter sequences. It should be renamed to blobSequences to match the updated function signature.
🔗 Analysis chain

Ensure all callers of CreateTxClient are updated to match the new signature

The function CreateTxClient has been updated with a new parameter upgradeSchedule and the parameter sequences has been renamed to blobSequences. To maintain consistency and prevent compilation errors, verify that all invocations of CreateTxClient across the codebase are updated to reflect these changes.

Run the following script to locate all usages of CreateTxClient and check for outdated parameter lists:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all calls to `CreateTxClient` and display their parameter lists.
# Expected: All calls should use the updated parameters.

rg --type go 'CreateTxClient\(' -A 5

Length of output: 106


Script:

#!/bin/bash
# Description: Find all calls to `CreateTxClient` and display their parameter lists.
# This script searches through Go files to locate `CreateTxClient` invocations.

rg --type go 'CreateTxClient\(([^)]*)\)' --with-filename --line-number

Length of output: 1123

test/txsim/upgrade.go Show resolved Hide resolved
test/txsim/upgrade.go Show resolved Hide resolved
test/e2e/major_upgrade_v3.go Show resolved Hide resolved
Comment on lines +83 to +84
testnet.NoError("failed to get header", err)
if resp.Header.Version.App == v3.Version {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ensure error handling after retrieving the header.

When calling client.Header(ctx, nil), if an error occurs, accessing resp.Header may result in a nil pointer dereference. This can cause the program to panic.

Modify the code to handle the error appropriately:

resp, err := client.Header(ctx, nil)
if err != nil {
    testnet.NoError("failed to get header", err)
    continue
}

Make sure that resp is not nil before accessing its fields.

Comment on lines 70 to 91
logger.Println("waiting for upgrade")
for _, node := range testNet.Nodes() {
client, err := node.Client()
testnet.NoError("failed to get client", err)

upgradeComplete := false
lastHeight := int64(0)
for !upgradeComplete {
select {
case <-timer.C:
return fmt.Errorf("failed to upgrade to v3, last height: %d", lastHeight)
case <-ticker.C:
resp, err := client.Header(ctx, nil)
testnet.NoError("failed to get header", err)
if resp.Header.Version.App == v3.Version {
upgradeComplete = true
}
fmt.Println("height", resp.Header.Height)
lastHeight = resp.Header.Height
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Handle timeouts and errors for each node individually.

The current implementation shares the same timer across all nodes. If one node delays the upgrade, it could cause the entire test to fail, even if others have succeeded.

Consider refactoring the code to handle timeouts and errors on a per-node basis to isolate issues and provide more detailed feedback.

test/e2e/testnet/testnet.go Outdated Show resolved Hide resolved
test/e2e/testnet/testnet.go Show resolved Hide resolved
@celestia-bot celestia-bot requested a review from a team October 7, 2024 03:44
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Outside diff range and nitpick comments (1)
test/e2e/testnet/testnet.go (1)

474-477: Add Documentation for the New Genesis Method

The Genesis method provides access to the genesis field but lacks a documentation comment. Adding a comment will improve code readability and help other developers understand its purpose.

Apply this diff to add the documentation:

+// Genesis returns the genesis configuration for the testnet.
 func (t *Testnet) Genesis() *genesis.Genesis {
 	return t.genesis
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between acc95b0 and 9641129.

📒 Files selected for processing (1)
  • test/e2e/testnet/testnet.go (8 hunks)
🧰 Additional context used

test/e2e/testnet/testnet.go Show resolved Hide resolved
test/e2e/testnet/testnet.go Show resolved Hide resolved
test/e2e/testnet/testnet.go Show resolved Hide resolved
test/e2e/testnet/testnet.go Show resolved Hide resolved
test/e2e/testnet/testnet.go Outdated Show resolved Hide resolved
Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

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

I’m currently reviewing the PR and leaving comments as I go through it. These are my thoughts so far. Overall, it looks great—thank you!

test/e2e/major_upgrade_v3.go Show resolved Hide resolved
test/e2e/minor_version_compatibility.go Show resolved Hide resolved
test/e2e/testnet/node.go Show resolved Hide resolved
test/e2e/testnet/testnet.go Show resolved Hide resolved
test/e2e/major_upgrade_v3.go Outdated Show resolved Hide resolved
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

LGTM

test/e2e/major_upgrade_v3.go Outdated Show resolved Hide resolved
test/e2e/major_upgrade_v3.go Outdated Show resolved Hide resolved
@celestia-bot celestia-bot requested a review from a team October 7, 2024 19:51
Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

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

When I try to run the test make test-e2e MajorUpgradeToV3, validators spun up just fine but the txCleint fails with this log:

Starting txsim with command:
/bin/txsim --key-path /var/folders/gl/8f7g64t91rxc6hsz_gj0mqfh0000gn/T/txsim --grpc-endpoint 10.38.154.62:9090 --poll-time 1s --seed 42 --blob 1 --blob-amounts 100 --blob-sizes 100-2000 --upgrade-schedule 20:3 --blob-share-version 0

Error: no accounts found in keyring

Did you encounter a similar issue?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
test/e2e/testnet/testnet.go (1)

174-174: Consider Making Account Balance Configurable

The account balance is hardcoded as 1e16. To improve flexibility and maintainability, consider making the balance a configurable parameter or defining it as a constant.

For example, define a constant for the balance:

const defaultAccountBalance = 1e16

And update the code:

 err = t.genesis.AddAccount(genesis.Account{
     PubKey:  pk,
-    Balance: 1e16,
+    Balance: defaultAccountBalance,
     Name:    name,
 })
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6e4fa05 and 11a01b0.

📒 Files selected for processing (1)
  • test/e2e/testnet/testnet.go (8 hunks)
🧰 Additional context used
🔇 Additional comments (2)
test/e2e/testnet/testnet.go (2)

132-143: Well-Documented Function Parameters

The CreateTxClient function now includes clear and detailed parameter documentation in the preceding comment block. This enhances readability and adheres to Go's documentation standards.


479-481: Well-Implemented Genesis Accessor Method

The addition of the Genesis() method provides controlled access to the genesis field of the Testnet struct. This adheres to good encapsulation practices and enhances the modularity of the code.

test/e2e/testnet/testnet.go Show resolved Hide resolved
@rootulp
Copy link
Collaborator

rootulp commented Oct 7, 2024

Did you encounter a similar issue?

I encountered that on an earlier commit of this PR but thought it was fixed after subsequent commits. Hmm I can repro on the most recent commit though.

@rootulp rootulp marked this pull request as draft October 7, 2024 20:19
@rootulp
Copy link
Collaborator

rootulp commented Oct 9, 2024

713bd50 works
acc95b0 doesn't work
9641129 doesn't work
6e4fa05 doesn't work
11a01b0 doesn't work

@rootulp rootulp requested review from rootulp, staheri14 and evan-forbes and removed request for rootulp October 9, 2024 03:07
@rootulp rootulp marked this pull request as ready for review October 9, 2024 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
required issue is required to be closed before workstream can be closed WS: V3 3️⃣ item is directly relevant to the v3 hardfork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an e2e major upgrade test for v3
5 participants