Skip to content

feat: wire in place testnet command#268

Merged
julienrbrt merged 10 commits into
mainfrom
julien/wireinplace-testnet
May 7, 2026
Merged

feat: wire in place testnet command#268
julienrbrt merged 10 commits into
mainfrom
julien/wireinplace-testnet

Conversation

@julienrbrt
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

@tbruyelle tbruyelle left a comment

Choose a reason for hiding this comment

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

Looks like there is some required setup needed for this command to works properly. For example I had to set a value in app.toml min-gas-prices, and also it requires a genesis.json to exists. Do we need the mainnet genesis here ?

@julienrbrt
Copy link
Copy Markdown
Collaborator Author

Looks like there is some required setup needed for this command to works properly. For example I had to set a value in app.toml min-gas-prices, and also it requires a genesis.json to exists. Do we need the mainnet genesis here ?

Yes, a valid genesis should be used, this is for cometbft to start properly. Any current valid genesis is fine, as the chainID will be overwritten by the command.

@tbruyelle
Copy link
Copy Markdown
Collaborator

It's not as smooth as I had imagined it, after I copied a genesis to the expected folder, I have an other problem:

error reading GenesisDoc at /home/tom/.atomone/validator1/config/genesis.json: invalid 64-bit integer encoding "1", expected string

Suprisingly it expects the initial_heigth to be a string rather than a number... I'm confused... Changing it to string doesnt solve the problem since somehow the process switch back the field to an int ...

@julienrbrt
Copy link
Copy Markdown
Collaborator Author

It's not as smooth as I had imagined it, after I copied a genesis to the expected folder, I have an other problem:

error reading GenesisDoc at /home/tom/.atomone/validator1/config/genesis.json: invalid 64-bit integer encoding "1", expected string

Suprisingly it expects the initial_heigth to be a string rather than a number... I'm confused... Changing it to string doesnt solve the problem since somehow the process switch back the field to an int ...

Welcome in the differences between AppGenesis and CometBFT genesis :D. Let's fix in our fork and just use the decoding fallback.

Yes this is why in Ignite we had a wrapper making the UX better.

@julienrbrt
Copy link
Copy Markdown
Collaborator Author

Welcome in the differences between AppGenesis and CometBFT genesis :D. Let's fix in our fork and just use the decoding fallback.

The fallback is already there actually, so both genesis should work 🤔

Comment thread cmd/atomoned/cmd/inplace_testnet.go Outdated
Comment thread cmd/atomoned/cmd/inplace_testnet.go
julienrbrt and others added 2 commits January 29, 2026 17:39
Co-authored-by: Thomas <thomas.bruyelle@tendermint.com>
Comment thread cmd/atomoned/cmd/inplace_testnet.go Outdated
Comment thread cmd/atomoned/cmd/inplace_testnet.go Outdated
@tbruyelle
Copy link
Copy Markdown
Collaborator

Now having a panic in the testnetify function because block is nil

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x1acfae8]

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/server.testnetify(0xc0031fa0a0, 0x51b8358, {0x56672a0, 0xc001594d40}, {0x0, 0x0})
	/home/tom/gohack/github.com/cosmos/cosmos-sdk/server/start.go:863 +0x17a8
github.com/cosmos/cosmos-sdk/server.startApp(0xc0031fa0a0, 0x51b8358, {0x51b8b40, 0x0, 0x0, 0x0, 0x51b8b50})
	/home/tom/gohack/github.com/cosmos/cosmos-sdk/server/start.go:616 +0x14e
github.com/cosmos/cosmos-sdk/server.start(_, {{0x0, 0x0, 0x0}, {0x566da38, 0xc0013a98f0}, 0x0, {0x0, 0x0}, {0x5683b08, ...}, ...}, ...)
	/home/tom/gohack/github.com/cosmos/cosmos-sdk/server/start.go:227 +0x159

julienrbrt and others added 2 commits February 13, 2026 16:41
Comment thread cmd/atomoned/cmd/inplace_testnet.go
Comment thread cmd/atomoned/cmd/inplace_testnet.go Outdated
@tbruyelle
Copy link
Copy Markdown
Collaborator

tbruyelle commented May 4, 2026

I made progress on using this command properly (initially I didnt understand that I need to use a snapshot of the mainnet before running it).

The main issue that I see now is that this command should be backported in v3.3.0, or else the mainnet store can't be read:

$ go run ./cmd/atomoned/ in-place-testnet testing-1 atonevaloper1e6ev26rgxzupty5u2g3mmk56dz85g473s7538e --home ~/.atomone/validator1 --accounts-to-fund=atone1e6ev26rgxzupty5u2g3mmk56dz85g473jrlcdp,atone1yzzzcft3qal7m9k6m33fhuslq7z4xvqm06uham
This operation will modify state in your data folder and cannot be undone. Do you want to continue? (y/n)
y
3:24PM ERR failed to load latest version err="failed to load latest version: version of store coredaos mismatch root store's version; expected 8378001 got 0; new stores should be added using StoreUpgrades" module=server
exit status 1

EDIT: backporting the change to SDK0.47 is not obvious since the InPlaceTestnetCreator was added in SDK50...

@tbruyelle
Copy link
Copy Markdown
Collaborator

Also added a setup documentation for using the command, let me know if it's correct 22b490d

@julienrbrt
Copy link
Copy Markdown
Collaborator Author

Also added a setup documentation for using the command, let me know if it's correct 22b490d

Yes, this looks good to me!

@julienrbrt
Copy link
Copy Markdown
Collaborator Author

EDIT: backporting the change to SDK0.47 is not obvious since the InPlaceTestnetCreator was added in SDK50...

In theory we don't need to, we can wait until we upgrade to v4 and use it from there. For instance for debugging the testnet if needed.
Osmosis had a fork, so they added it in v0.47 of their version, but for us it makes sense to support it from v4 and on.

@julienrbrt julienrbrt requested a review from tbruyelle May 6, 2026 21:15
@tbruyelle
Copy link
Copy Markdown
Collaborator

In theory we don't need to, we can wait until we upgrade to v4 and use it from there. For instance for debugging the testnet if needed.

OK, I was hoping to use it to test the v4 upgrade, but let's use it later.

@julienrbrt julienrbrt merged commit 5e3a5d7 into main May 7, 2026
14 checks passed
@julienrbrt julienrbrt deleted the julien/wireinplace-testnet branch May 7, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire in place testnet command

3 participants