-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: LSM changes to staking #7
Conversation
DefaultWeightMsgFundCommunityPool int = 50 | ||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec | ||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec | ||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials
DefaultWeightMsgWithdrawValidatorCommission int = 50 | ||
DefaultWeightMsgFundCommunityPool int = 50 | ||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec | ||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials
DefaultWeightMsgWithdrawDelegationReward int = 50 | ||
DefaultWeightMsgWithdrawValidatorCommission int = 50 | ||
DefaultWeightMsgFundCommunityPool int = 50 | ||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec | ||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec | ||
OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" //nolint:gosec | ||
OpWeightMsgWithdrawAllTokenizeShareRecordReward = "op_weight_msg_withdraw_all_tokenize_share_record_reward" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec | ||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec | ||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec | ||
OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials
TypeMsgRedeemTokensForShares = "redeem_tokens_for_shares" | ||
TypeMsgTransferTokenizeShareRecord = "transfer_tokenize_share_record" | ||
TypeMsgDisableTokenizeShares = "disable_tokenize_shares" | ||
TypeMsgEnableTokenizeShares = "enable_tokenize_shares" |
Check failure
Code scanning / gosec
Potential hardcoded credentials
TypeMsgBeginRedelegate = "begin_redelegate" | ||
TypeMsgUpdateParams = "update_params" | ||
TypeMsgTokenizeShares = "tokenize_shares" | ||
TypeMsgRedeemTokensForShares = "redeem_tokens_for_shares" |
Check failure
Code scanning / gosec
Potential hardcoded credentials
x/distribution/types/msg.go
Outdated
func (msg MsgWithdrawTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { | ||
owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
x/distribution/types/msg.go
Outdated
func (msg MsgWithdrawAllTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { | ||
owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
@@ -17,6 +17,7 @@ | |||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) | |||
|
|||
k.TrackHistoricalInfo(ctx) | |||
k.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func (msg MsgUnbondValidator) GetSigners() []sdk.AccAddress { | ||
valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func (msg MsgTokenizeShares) GetSigners() []sdk.AccAddress { | ||
delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func (msg MsgRedeemTokensForShares) GetSigners() []sdk.AccAddress { | ||
delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func (msg MsgTransferTokenizeShareRecord) GetSigners() []sdk.AccAddress { | ||
sender, err := sdk.AccAddressFromBech32(msg.Sender) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func (msg MsgDisableTokenizeShares) GetSigners() []sdk.AccAddress { | ||
sender, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func (msg MsgEnableTokenizeShares) GetSigners() []sdk.AccAddress { | ||
sender, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func (msg MsgValidatorBond) GetSigners() []sdk.AccAddress { | ||
delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
tag LSM tests to be refactored Fix nits
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.
gosec found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
|
||
tokensBz, err := tokens.Marshal() | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
|
||
var tokens sdk.Int | ||
if err := tokens.Unmarshal(tokensBz); err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
// This only error's if the total liquid staked tokens underflows | ||
// which would indicate there's a corrupted state where the validator has | ||
// liquid tokens that are not accounted for in the global total | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
...cTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail
Outdated
Show resolved
Hide resolved
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.
The logic seems good. Check my comments below. Also,
- the following tests are missing:
TestNewTokenizeSharesCmd
,TestNewRedeemTokensCmd
,TestNewTransferTokenizeShareRecordCmd
(before inx/staking/client/testutil/suite.go
); - signers in
proto/cosmos/staking/v1beta1/tx.proto
are missing (checkx/staking/types/msg.go
to identify the signers for each message); - let's not forget to add the necessary changes to
RandomFees
intypes/simulation/account.go
cc @MSalopek
Co-authored-by: Marius Poke <[email protected]>
Co-authored-by: Marius Poke <[email protected]>
Description
Closes: #XXXX
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
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...
!
in the type prefix if API or client breaking change