-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
v2 genesis #20076
v2 genesis #20076
Conversation
- genesis subcommand needs implementation
Important Auto Review SkippedAuto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
type ContextKey string | ||
|
||
// TODO: remove | ||
const CometInfoKey ContextKey = "comet-info" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For usage see: https://github.com/cosmos/cosmos-sdk/blob/kocu/genesis-v2/x/distribution/keeper/abci.go#L27
I think this can be resolved with #19602 which adds a message to retrieve CometInfo
from the RouterService, or optionally including a keeper.
@@ -26,6 +28,7 @@ import ( | |||
|
|||
"github.com/cosmos/cosmos-sdk/codec" | |||
sdkmodule "github.com/cosmos/cosmos-sdk/types/module" | |||
"github.com/cosmos/cosmos-sdk/x/genutil/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remove this dependency a genesis themed extension interface in x/genutil
could be used to return []json.RawMessage
for server v2.
Power: evi.Validator.Power, | ||
}, | ||
Height: evi.Height, | ||
Time: &evi.Time, |
Check failure
Code scanning / gosec
Implicit memory aliasing in for loop. Error
Height: e.Height, | ||
Time: ×tamppb.Timestamp{Seconds: int64(e.Time.Second())}, // safe? | ||
Time: &e.Time, |
Check failure
Code scanning / gosec
Implicit memory aliasing in for loop. Error
previousTotalPower += vote.Validator.Power | ||
} | ||
voteInfos := cometInfo.LastCommit.Votes | ||
if err := k.AllocateTokens(ctx, previousTotalPower, voteInfos); err != nil { |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
runtime/v2/manager.go
Outdated
} | ||
|
||
// we might get an adapted module, a native core API module or a legacy module | ||
if module, ok := mod.(appmodule.HasGenesisAuto); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't support appmodule.HasGenesisAuto
here, imho only appmodulev2 logic.
Description
Progresses work on Genesis to a point where
stf.deliverTx
fails during TxValidation at this site: https://github.com/cosmos/cosmos-sdk/blob/kocu/genesis-v2/x/auth/module.go#L148-L151 due to a cast tosdk.Context
.Hoists GenTxs up to
AppManager[T].InitGenesis
so that genesis txs are included in the genesis block.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...