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

feat!: disable x/blobstream in v2 #3310

Merged
merged 37 commits into from
Apr 27, 2024

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Apr 12, 2024

Closes #3305

Testing

Manually verified on a local devnet that a user can register an EVM address if the chain is on app version 1.
$   celestia-appd tx qgb register \
    "$(celestia-appd keys show validator --home ${CELESTIA_APP_HOME} --bech val -a)" \
    0x966e6f22781EF6a6A82BBB4DB3df8E225DfD9485 \
    --from ${KEY_NAME} \
    --home ${CELESTIA_APP_HOME} \
    --fees 30000utia \
    --broadcast-mode block \
    --yes
code: 0
codespace: ""
data: 12300A2E2F63656C65737469612E7167622E76312E4D7367526567697374657245564D41646472657373526573706F6E7365
events:
- attributes:
  - index: true
    key: c3BlbmRlcg==
    value: Y2VsZXN0aWExc3B6YWU4MzNnM2E4dDQwdXN3NTAyZXR4dHo2c2czaG5meDg4OHc=
  - index: true
    key: YW1vdW50
    value: MzAwMDB1dGlh
  type: coin_spent
- attributes:
  - index: true
    key: cmVjZWl2ZXI=
    value: Y2VsZXN0aWExN3hwZnZha20yYW1nOTYyeWxzNmY4NHoza2VsbDhjNWxwbmpzM3M=
  - index: true
    key: YW1vdW50
    value: MzAwMDB1dGlh
  type: coin_received
- attributes:
  - index: true
    key: cmVjaXBpZW50
    value: Y2VsZXN0aWExN3hwZnZha20yYW1nOTYyeWxzNmY4NHoza2VsbDhjNWxwbmpzM3M=
  - index: true
    key: c2VuZGVy
    value: Y2VsZXN0aWExc3B6YWU4MzNnM2E4dDQwdXN3NTAyZXR4dHo2c2czaG5meDg4OHc=
  - index: true
    key: YW1vdW50
    value: MzAwMDB1dGlh
  type: transfer
- attributes:
  - index: true
    key: c2VuZGVy
    value: Y2VsZXN0aWExc3B6YWU4MzNnM2E4dDQwdXN3NTAyZXR4dHo2c2czaG5meDg4OHc=
  type: message
- attributes:
  - index: true
    key: ZmVl
    value: MzAwMDB1dGlh
  - index: true
    key: ZmVlX3BheWVy
    value: Y2VsZXN0aWExc3B6YWU4MzNnM2E4dDQwdXN3NTAyZXR4dHo2c2czaG5meDg4OHc=
  type: tx
- attributes:
  - index: true
    key: YWNjX3NlcQ==
    value: Y2VsZXN0aWExc3B6YWU4MzNnM2E4dDQwdXN3NTAyZXR4dHo2c2czaG5meDg4OHcvMQ==
  type: tx
- attributes:
  - index: true
    key: c2lnbmF0dXJl
    value: U1lIMjZsRHN4V2JEMzRQdVBMaFl0eXB5NTh6TzhJVHFxc09qYm5Kb0RyVUJSQlFCTEpIdHNuRXY0YXVoaUpCK0ppUExZVVJMc1lESDZ5ZUdKQ3EwaEE9PQ==
  type: tx
- attributes:
  - index: true
    key: YWN0aW9u
    value: L2NlbGVzdGlhLnFnYi52MS5Nc2dSZWdpc3RlckVWTUFkZHJlc3M=
  type: message
gas_used: "66959"
gas_wanted: "210000"
height: "2"
info: ""
logs:
- events:
  - attributes:
    - key: action
      value: /celestia.qgb.v1.MsgRegisterEVMAddress
    type: message
  log: ""
  msg_index: 0
raw_log: '[{"msg_index":0,"events":[{"type":"message","attributes":[{"key":"action","value":"/celestia.qgb.v1.MsgRegisterEVMAddress"}]}]}]'
timestamp: ""
tx: null
txhash: 60FD4A8507E95637FE97178FBB3F4E202F679D81A59E509C5E72A6815C221085
Manually verify on a local devnet that a user can't register an EVM address if the chain is on app version 2.
$   celestia-appd tx qgb register \
    "$(celestia-appd keys show validator --home ${CELESTIA_APP_HOME} --bech val -a)" \
    0x966e6f22781EF6a6A82BBB4DB3df8E225DfD9485 \
    --from ${KEY_NAME} \
    --home ${CELESTIA_APP_HOME} \
    --fees 30000utia \
    --broadcast-mode block \
    --yes

code: 37
codespace: sdk
data: ""
events: []
gas_used: "8786"
gas_wanted: "-1"
height: "0"
info: ""
logs: []
raw_log: 'message type /celestia.qgb.v1.MsgRegisterEVMAddress is not supported in
  version 2: feature not supported'
timestamp: ""
tx: null
txhash: E378761B61CA6D29C36957DBCAE65E4CED82788735BC3CF21A86B677970BCBD9
Manually verified that tx and query CLI commands don't work.
$ celestia-appd tx qgb
Error: unknown command "qgb" for "tx"
$ celestia-appd query qgb
Error: unknown command "qgb" for "query"

Manually verified that gRPC queries don't work

Screenshot 2024-04-24 at 2 04 23 PM

@rootulp rootulp self-assigned this Apr 12, 2024
@rootulp

This comment was marked as resolved.

@cmwaters
Copy link
Contributor

Could it be from this:

celestia-app/app/app.go

Lines 274 to 277 in 58fc315

stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(),
app.SlashingKeeper.Hooks(),
app.BlobstreamKeeper.Hooks(),
),

@cmwaters
Copy link
Contributor

When does this panic happen? Is it in the genesis block?

@rootulp
Copy link
Collaborator Author

rootulp commented Apr 22, 2024

IIRC it was on very early on in single-node.sh so likely genesis block. Will investigate the hooks you linked, good call out.

@rootulp
Copy link
Collaborator Author

rootulp commented Apr 23, 2024

Yep it was from the blobstream hooks. I'll investigate how to make those hooks versioned because IIUC, we want the staking keeper to have the blobstream hooks in app v1 and not have the blobstream hooks in app v2.

@rootulp rootulp marked this pull request as ready for review April 24, 2024 18:10
@rootulp rootulp requested review from rach-id, evan-forbes, liamsi and a team as code owners April 24, 2024 18:10
Copy link
Contributor

coderabbitai bot commented Apr 24, 2024

Warning

Rate Limit Exceeded

@rootulp has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 48 minutes and 41 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between b406002 and 46e9690.

Walkthrough

The changes primarily focus on disabling the x/blobstream module for app version 2 across various files, including adjustments in versioning logic, RPC tests, and configuration settings. Additionally, there are updates to the module's documentation and test suites to align with the new versioning strategy.

Changes

File Path Change Summary
app/modules.go Adjusted versioning logic, modified FromVersion and ToVersion values for a module.
app/test/qgb_rpc_test.go Updated RPC test function with new configuration settings.
specs/src/specs/state_machine_modules.md Removed blobstream module link for celestia-app specific modules list.
x/blobstream/... Various updates across module files to disable functionality for app version >= 2.
x/blobstream/client/suite_test.go Added import and modified configuration initialization in test setup.
x/blobstream/integration_test.go Updated configuration setup and reformatted method calls in integration test.
x/blobstream/keeper/... Added conditional checks and minor comment adjustments in hooks and their tests.
x/blobstream/module.go Disabled module in app version 2, affecting command functions and removed specific imports.

Possibly related issues

  • Disable x/blobstream in v2 #3305: The changes in this PR directly address disabling the x/blobstream module for app version 2, which aligns with the proposal in this issue.

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:

Note: Auto-reply has been disabled for this repository by the repository owner. 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

rootulp added a commit to rootulp/CIPs that referenced this pull request Apr 24, 2024
@rootulp rootulp requested review from cmwaters and removed request for a team and liamsi April 24, 2024 18:19
@rootulp rootulp added the WS: V2 ✌️ lemongrass hardfork related label Apr 24, 2024
rootulp added a commit that referenced this pull request Apr 24, 2024
A bunch of small refactors I made while working on
#3310
Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

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

Thanks for handling this 🙏

Left a few questions to understand more

app/test/qgb_rpc_test.go Show resolved Hide resolved
x/blobstream/keeper/hooks.go Outdated Show resolved Hide resolved
x/blobstream/keeper/hooks_test.go Outdated Show resolved Hide resolved
x/blobstream/module.go Show resolved Hide resolved
x/blobstream/module.go Show resolved Hide resolved
@celestia-bot celestia-bot requested a review from a team April 25, 2024 14:47
@rootulp rootulp requested a review from rach-id April 25, 2024 14:58
ninabarbakadze pushed a commit to ninabarbakadze/celestia-app that referenced this pull request Apr 25, 2024
A bunch of small refactors I made while working on
celestiaorg#3310
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.

nice, does this fully close #3305, specifically point 5 where we migrate state?

@rootulp
Copy link
Collaborator Author

rootulp commented Apr 25, 2024

Great question! I assumed since the blobstream store key isn't registered in v2, there would be no place to store blobstream state in the multistore but I'll double check that 👀

Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

Thanks for doing all the manual checks.

Perhaps we can modify the upgrade_test.go in app to check that blobstream works in v1 and doesn't work in v2. Just a suggestion. Can be done as a follow up

@rootulp
Copy link
Collaborator Author

rootulp commented Apr 27, 2024

nice, does this fully close #3305, specifically point 5 where we migrate state?

I verified that the blobstream KV store doesn't exist in app version 2. I added this to EndBlocker:

	store := app.CommitMultiStore().GetKVStore(app.keys[blobstreamtypes.StoreKey])
	size := 0
	iterator := store.Iterator(nil, nil)
	defer iterator.Close()
	for ; iterator.Valid(); iterator.Next() {
		fmt.Printf("key %v, value %v\n", iterator.Key(), iterator.Value())
		size += len(iterator.Key())
		size += len(iterator.Value())
	}
	fmt.Printf("blobstream store size %v\n", size)

and when I run a node, I can see that the blobstream store does exist prior to upgrading app versions:

blobstream store size 247

and it does not exist after upgrading app version

6:54PM ERR CONSENSUS FAILURE!!! err="store does not exist for key: qgb" module=consensus stack="goroutine 132 [running]:\nruntime/debug.Stack()\n\t/Users/rootulp/go/pkg/mod/golang.org/[email protected]/src/runtime/debug/stack.go:24 +0x64\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine.func2()\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:746 +0x44\npanic({0x106c39bc0?, 0x140016241c0?})\n\t/Users/rootulp/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:770 +0x124\ngithub.com/cosmos/cosmos-sdk/store/rootmulti.(*Store).GetKVStore(0x140010e8fd0, {0x107099d28, 0x140011609a0})\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/store/rootmulti/store.go:562 +0x2bc\ngithub.com/celestiaorg/celestia-app/v2/app.(*App).EndBlocker(_, {{0x1070b34d8, 0x1084c4fc0}, {0x1070c5620, 0x14004a89c40}, {{0xb, 0x2}, {0x14001105009, 0x7}, 0x3, ...}, ...}, ...)\n\t/Users/rootulp/git/rootulp/celestiaorg/celestia-app/app/app.go:462 +0x1f0\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).EndBlock(0x14000016f00, {0x12fee2fa0?})\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/baseapp/abci.go:222 +0xfc\ngithub.com/tendermint/tendermint/abci/client.(*localClient).EndBlockSync(0x14001c80780, {0x1058426ac?})\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/abci/client/local_client.go:314 +0xec\ngithub.com/tendermint/tendermint/proxy.(*appConnConsensus).EndBlockSync(0x140043ff940?, {0x20?})\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/proxy/app_conn.go:92 +0x28\ngithub.com/tendermint/tendermint/state.execBlockOnProxyApp({0x1070b3890, 0x14000421030}, {0x1070c2e40, 0x140011a8fc0}, 0x140047ba1e0, {0x1070c5cf8, 0x1400130e000}, 0x1)\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/state/execution.go:413 +0x5bc\ngithub.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(_, {{{0xb, 0x2}, {0x140010a04a9, 0x7}}, {0x140010a04c0, 0x7}, 0x1, 0x2, {{0x14001051f60, ...}, ...}, ...}, ...)\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/state/execution.go:221 +0x12c\ngithub.com/tendermint/tendermint/consensus.(*State).finalizeCommit(0x14001394e08, 0x3)\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:1698 +0x900\ngithub.com/tendermint/tendermint/consensus.(*State).tryFinalizeCommit(0x14001394e08, 0x3)\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:1606 +0x26c\ngithub.com/tendermint/tendermint/consensus.(*State).enterCommit.func1()\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:1541 +0x8c\ngithub.com/tendermint/tendermint/consensus.(*State).enterCommit(0x14001394e08, 0x3, 0x0)\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:1579 +0xac4\ngithub.com/tendermint/tendermint/consensus.(*State).addVote(0x14001394e08, 0x140041d0b40, {0x0, 0x0})\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:2215 +0x13c8\ngithub.com/tendermint/tendermint/consensus.(*State).tryAddVote(0x14001394e08, 0x140041d0b40, {0x0?, 0x10461b3b0?})\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:2007 +0x28\ngithub.com/tendermint/tendermint/consensus.(*State).handleMsg(0x14001394e08, {{0x107093e40, 0x1400104e648}, {0x0, 0x0}})\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:875 +0x110\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine(0x14001394e08, 0x0)\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:802 +0x370\ncreated by github.com/tendermint/tendermint/consensus.(*State).OnStart in goroutine 12\n\t/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/consensus/state.go:391 +0x110\n"

@rootulp rootulp mentioned this pull request Apr 27, 2024
@rootulp rootulp merged commit 96b80be into celestiaorg:main Apr 27, 2024
34 checks passed
@rootulp rootulp deleted the rp/remove-blobstream branch April 27, 2024 22:58
ninabarbakadze pushed a commit to ninabarbakadze/celestia-app that referenced this pull request May 10, 2024
A bunch of small refactors I made while working on
celestiaorg#3310
0xchainlover pushed a commit to celestia-org/celestia-app that referenced this pull request Aug 1, 2024
A bunch of small refactors I made while working on
celestiaorg/celestia-app#3310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WS: V2 ✌️ lemongrass hardfork related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable x/blobstream in v2
4 participants