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
| 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
| 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
| 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.
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
mpoke
left a comment
There was a problem hiding this comment.
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.protoare missing (checkx/staking/types/msg.goto identify the signers for each message); - let's not forget to add the necessary changes to
RandomFeesintypes/simulation/account.gocc @MSalopek
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
* POS-1956: solved conflicts * POS-1956: refactor ante decorators based on heimdall * POS-1956: remove comment * POS-1956: revert some minor changes * chg: rename todo comments * chg: comments * Addressed a few TODOs in auth (#2) * resolved todos in keeper.go (except 1) * updated x/auth/keeper/grpc_query.go with comments * added comments in auth/module.go * removed depinject from auth.ModuleInputs * resolved TODOs in auth/keeper/genesis (created NewBaseAccount and passed to processor) * removed some TODOs from x/auth/types/account.go * added few comments in x/auth/ante/ante.go * few final comments and modifications * add: generate proto files * chg: solve some TODOs * chg: solve some TODOs / restore multiSign as this won't be anyway used * chg: solve some TODOs / restore original AccAddress due to new strategy * chg: solve some TODOs / fix some tests / continue revert on AccAddress * chg: fix on signers loop * chg: fix on signers loop / 2 * chg: fix some tests and skip others * chg: regress to AccAddress for keyring record * chg: implement Addresses as hex entities / fix build and tests (for auth) * chg: fix build for other modules * chg: fix build for simapp / workaround for evidence module * chg: address more TODOs / use empty default prefix / fix build for prefix changes * chg: minor changes * chg: modify auth README * chg: remove bech32 comments / fix address codec * chg: improve comments * chg: rename hex codecs / add 0x prefix on address strings / fix tests accordingly * chg: add emptyness check on string method for address / restore original txBuilder tests * chg: more meaningful comments for the upcoming PR reviews * chg: remove bech22-related code / remove hex prefix / replace feeCollector with bankKeeper / address PR comments * chg: address PR comments / temp comment out scheduled CI jobs * chg: delete pulp related files / fix typo * chg: solve some TODOs / fix some tests and provide context for skipped tests * chg: remove SetGasMeter call and fix mempool test accordingly * chg: remove StdTxRaw * chg: address PR comments * chg: unskip other tests / distinguish TODO HV2 comments from HV2 comments * chg: fix VerifyAddressFormat / move fees reletad vars / remove ante handlers in simapp / adapt tests * chg: skip AccountProcessors for the time being in depInject / Re-enable tests accordingly * chg: increase test balances to pay for the DefaultMaxFee in heimdall / re-enable TestAccountRetriever test * chg: update a comment * chg: remove AccountProcessors until implemented at the end of migration * chg: add a TODO comment for HV2 sigVerify * fix typo in client/keys/show.go Co-authored-by: Sergio Mena <sergio@informal.systems> * chg: better comment for a TODO case * chg: better comment on TODO action * chg: add comment for credentials tests * chg: simplify txFeesSum for keeper_test * chg: fix comment on AddressBytesToString method * chg: fix comment on AddressBytesToString method /2 * chg: disable multisig * chg: implement cometBFT changes and adapt tests accordingly * chg: address PR comments * chg: better context for HV2 TODOs * chg: address comments to remove PublicKey_Secp256K1 cases * chg: updated cometBFT version to first 0xPolygon release * chg: address PR comments * chg: address PR comments * chg: go mod tidy all * chg: merge auth * chg: go mod tidy * chg: fix tests * chg: fix TestAminoUnmarshalJSON * chg: add DefaultFeeInMatic concept in auth README * chg: address comments * chg: better comment on panic * chg: remove vesting accounts from RandomGenesisAccounts during simulation * chg: update go deps for sdk and simapp * chg: removed comment for HFs * chg: remove heimdall types * chg: fix keyring tests * Porting: gov module (#7) * add: port gov module * chg: implement WeightedVoteOptions with constraints * chg: better TODOs descriptions * chg: POS-2135: fix some tests * chg: POS-2135: fix more tests * chg: POS-2135: update an address format * chg: fix few more tests * chg: fix few more tests * chg: fix some tests / temp revert some others to properly tune params later on * chg: fix TestHooks * chg: fix burn related methods / fix tests * chg: fix query for WeightedVoteOptions / better comments * chg: fix all tests in gov module * chg: fix a staking integration test * chg: POS-2142: edit gov readme * chg: use AccAddressFromHex in tests instead of addressCodec * chg: enable one test / provide better context for the only skipped test * chg: use hex acc addresses in gov tests * chg: return empty string on ProposalType normalization * chg: remove TextProposals / add comment for Msgs auto-execution * chg: re-enable textProposals / TBD with team * chg: remove comment * chg: better context for HV2 TODOs * chg: filter out non valid proposals msgs types and content * chg: fix typeUrls * chg: filter out not supported messages at time of proposals submit / fix tests accordingly * chg: go mod tidy * chg: address PR comments: filtering dedicated file / test msg types / edit comments * chg: register interfaces in gov test app * chg: better context for comments * chg: comment for future improvements * chg: consistent example of gov tx for submit proposal * chg: add msgServers in testApp to allow additional MsgUpdateParams types * chg: fix tests after merge * chg: update go deps for sdk and simapp * chg: comment * chg: comment in README for further actions --------- Co-authored-by: Raneet Debnath <raneetdebnath10@gmail.com> * Porting: bank module (#5) * proto,x/bank: initial port of heimdall related changes for bank module * x/bank: rm moduleName param from SubtractCoins + rm MsgSetSendEnabled,add MsgMultiSend to amino registry + rm unused commented code * simapp,x/auth,x/bank: address PR comments * x/bank: change feeAmount to defaultFeeAmount in test * x/bank: address PR comments * x/bank: use CreateRandomValidatorSet instead of manually initialising validator set in tests * x/bank,proto: change heimdall v2 comment format * all: fix broken simapp dep * x/bank: rm SetCoins * x/auth,x/bank: modify bank tests with assertions for fee_collector and account balances * x/bank: minor code refactors --------- Co-authored-by: Raneet Debnath <raneetdebnath10@gmail.com> Co-authored-by: Pratik Patil <pratikspatil024@gmail.com> Co-authored-by: Sergio Mena <sergio@informal.systems> Co-authored-by: Raneet Debnath <35629432+Raneet10@users.noreply.github.com>
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.mdmake lintandmake testReviewers 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