diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index 6aa864180720..60a2b953c905 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -55,7 +55,7 @@ func (m BlockGasImpl) Set(ctx context.Context, msg *baseapptestutil.MsgKeyValue) } func TestBaseApp_BlockGas(t *testing.T) { - t.Skip("TODO HV2: fix and enable this test?") + t.Skip("TODO HV2: fix and enable this test") testcases := []struct { name string gasToConsume uint64 // gas to consume in the msg execution diff --git a/crypto/keyring/keyring_ledger_test.go b/crypto/keyring/keyring_ledger_test.go index d99fa68272b8..1d7915ac559f 100644 --- a/crypto/keyring/keyring_ledger_test.go +++ b/crypto/keyring/keyring_ledger_test.go @@ -56,7 +56,7 @@ func TestInMemoryCreateLedger(t *testing.T) { // TestSignVerify does some detailed checks on how we sign and validate // signatures func TestSignVerifyKeyRingWithLedger(t *testing.T) { - t.Skip("TODO HV2: fix and enable this test? Is ledger supported?") + t.Skip("TODO HV2: fix and enable this test") dir := t.TempDir() cdc := getCodec() @@ -140,7 +140,7 @@ func TestAltKeyring_SaveLedgerKey(t *testing.T) { } func TestSignWithLedger(t *testing.T) { - t.Skip("TODO HV2: fix and enable this test? Is ledger supported?") + t.Skip("TODO HV2: fix and enable this test") // Create two distinct Ledger records: recordA and recordB. // RecordA is added to the Ledger but recordB is not added. pathA := hd.NewFundraiserParams(0, types.CoinType, 0) diff --git a/crypto/ledger/ledger_test.go b/crypto/ledger/ledger_test.go index efd154535583..08f56c466820 100644 --- a/crypto/ledger/ledger_test.go +++ b/crypto/ledger/ledger_test.go @@ -192,7 +192,7 @@ func getFakeTx(accountNumber uint32) []byte { } func TestSignaturesHD(t *testing.T) { - t.Skip("TODO HV2: enable and fix this test?") + t.Skip("TODO HV2: fix and enable this test") for account := uint32(0); account < 100; account += 30 { msg := getFakeTx(account) @@ -212,7 +212,7 @@ func TestSignaturesHD(t *testing.T) { } func TestRealDeviceSecp256k1(t *testing.T) { - t.Skip("TODO HV2: enable and fix this test?") + t.Skip("TODO HV2: fix and enable this test") msg := getFakeTx(50) path := *hd.NewFundraiserParams(0, sdk.CoinType, 0) priv, err := NewPrivKeySecp256k1Unsafe(path) diff --git a/orm/encoding/ormkv/key_codec_test.go b/orm/encoding/ormkv/key_codec_test.go index 0e30e7655de3..c9a0fad2d2bd 100644 --- a/orm/encoding/ormkv/key_codec_test.go +++ b/orm/encoding/ormkv/key_codec_test.go @@ -16,7 +16,7 @@ import ( ) func TestKeyCodec(t *testing.T) { - t.Skip("TODO HV2: enable and fix this test?") + t.Skip("TODO HV2: fix and enable this test") rapid.Check(t, func(t *rapid.T) { key := testutil.TestKeyCodecGen(0, 5).Draw(t, "key") for i := 0; i < 100; i++ { diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 69f43674e0a5..266b18177fe0 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -45,8 +45,6 @@ message WeightedVoteOption { ]; } -// TODO HV2: TextProposals are disabled in heimdall. If we remove it, we need to re-implement all tests. It should be ok as is. - // TextProposal defines a standard text proposal whose changes need to be manually updated in case of approval. message TextProposal { option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; diff --git a/server/util_test.go b/server/util_test.go index 5653767eeb1d..af78a385c264 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -421,7 +421,7 @@ func TestInterceptConfigsWithBadPermissions(t *testing.T) { } func TestEmptyMinGasPrices(t *testing.T) { - t.Skip("TODO HV2: enable and fix this test?") + t.Skip("TODO HV2: fix and enable this test") tempDir := t.TempDir() err := os.Mkdir(filepath.Join(tempDir, "config"), os.ModePerm) require.NoError(t, err) diff --git a/simapp/app_di.go b/simapp/app_di.go index faa81ca593bd..c887862a3af0 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -96,9 +96,6 @@ func init() { } } -// TODO HV2: To fix many tests, we need to implement https://polygon.atlassian.net/browse/POS-2540 -// and change NewSimApp function accordingly - // NewSimApp returns a reference to an initialized SimApp. func NewSimApp( logger log.Logger, diff --git a/tests/integration/bank/keeper/deterministic_test.go b/tests/integration/bank/keeper/deterministic_test.go index 2842e6798444..3c2b36d4ae80 100644 --- a/tests/integration/bank/keeper/deterministic_test.go +++ b/tests/integration/bank/keeper/deterministic_test.go @@ -187,7 +187,7 @@ func TestGRPCQueryAllBalances(t *testing.T) { } func TestGRPCQuerySpendableBalances(t *testing.T) { - t.Skip("TODO HV2: fix and enable this test?") + t.Skip("TODO HV2: fix and enable this test") t.Parallel() f := initDeterministicFixture(t) diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index e68d1f6a7279..dc0ae126d876 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -459,7 +459,7 @@ func TestMsgSetWithdrawAddress(t *testing.T) { } func TestMsgWithdrawValidatorCommission(t *testing.T) { - t.Skip("TODO HV2: fix and enable this test?") + t.Skip("TODO HV2: fix and enable this test") t.Parallel() f := initFixture(t) diff --git a/tests/integration/tx/aminojson/aminojson_test.go b/tests/integration/tx/aminojson/aminojson_test.go index e9710608c902..aef5c64d52c8 100644 --- a/tests/integration/tx/aminojson/aminojson_test.go +++ b/tests/integration/tx/aminojson/aminojson_test.go @@ -234,9 +234,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) { }, roundTripUnequal: true, }, - /* TODO HV2: this fails because `keys.pulsar.go` doesn't have the new key changes - from https://github.com/0xPolygon/cosmos-sdk/commits/mardizzone/POS-2511-auth/api/cosmos/crypto/secp256k1/keys.pulsar.go. - Fix the tests based on https://polygon.atlassian.net/browse/POS-2730 + /* TODO HV2: https://polygon.atlassian.net/browse/POS-2756 "auth/base_account": { gogo: &authtypes.BaseAccount{Address: addr1Str, PubKey: pubkeyAny}, pulsar: &authapi.BaseAccount{Address: addr1Str, PubKey: pubkeyAnyPulsar}, @@ -283,10 +281,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) { gogo: &ed25519types.PubKey{Key: []byte("key")}, pulsar: &ed25519.PubKey{Key: []byte("key")}, }, - /* TODO HV2: this succeeds because `keys.pulsar.go` doesn't have the new key changes - from https://github.com/0xPolygon/cosmos-sdk/commits/mardizzone/POS-2511-auth/api/cosmos/crypto/secp256k1/keys.pulsar.go. - Update the deps and fix the tests based on https://polygon.atlassian.net/browse/POS-2730 - */ + // TODO HV2: https://polygon.atlassian.net/browse/POS-2756 "crypto/secp256k1": { gogo: &secp256k1types.PubKeyOld{Key: []byte("key")}, pulsar: &secp256k1.PubKey{Key: []byte("key")}, diff --git a/testutil/network/network.go b/testutil/network/network.go index d08867ef925a..c7aebb2b2c24 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -331,9 +331,6 @@ func NewCLILogger(cmd *cobra.Command) CLILogger { return CLILogger{cmd} } -// TODO HV2: To fix many tests, we need to implement https://polygon.atlassian.net/browse/POS-2540 -// and change New function accordingly - // New creates a new Network for integration tests or in-process testnets run via the CLI func New(l Logger, baseDir string, cfg Config) (*Network, error) { // only one caller/test can create and use a network at a time diff --git a/tools/confix/upgrade_test.go b/tools/confix/upgrade_test.go index 5cd942419cd2..e85192844c9c 100644 --- a/tools/confix/upgrade_test.go +++ b/tools/confix/upgrade_test.go @@ -19,7 +19,7 @@ func mustReadConfig(t *testing.T, path string) []byte { } func TestCheckValid(t *testing.T) { - t.Skip("TODO HV2: enable and fix this test?") + t.Skip("TODO HV2: fix and enable this test") err := confix.CheckValid("foo", []byte{}) assert.ErrorContains(t, err, "unknown config") diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index beaa625fa47c..f2d540f2abd0 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -33,7 +33,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder") } - if options.SignModeHandler == nil { // TODO HV2: confirm signing mode for heimdall is SignMode_SIGN_MODE_DIRECT + if options.SignModeHandler == nil { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index 859d5bbafa26..f9733ea04842 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -26,8 +26,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) -// TODO HV2: reconcile this file with heimdall's `auth/ante_test.go` (e.g. implement heimdall specific tests like `TestCheckpointGasLimit` and milestones related tests) - // Test that simulate transaction accurately estimates gas cost func TestSimulateGasCost(t *testing.T) { // This test has a test case that uses another's output. diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index c4170a9f025f..b8e779b7c93d 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -110,43 +110,6 @@ func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidPubKey, err.Error()) } - /* TODO HV2: The following code is intended to comply with heimdall v1 (see https://polygon.atlassian.net/browse/POS-2492). - There, `RecoverPubKey` is used to obtain the public key according to the eth-go library. - This was done in x/auth/ante.go `processSig` method, which is now part of the `SigVerificationDecorator`. - However, in v0.50.x, the `SigVerificationDecorator` expects the pubKey to be already set in `SetPubKeyDecorator`. - So, this logic is now moved under `SetPubKeyDecorator`, which also requires a `signModeHandler` to invoke the `VerifySignature`. - Such `VerifySignature` method has been modified to return the recovered public key, which is then set in the account. - This code is hit every time pubKeys are set and txs (in `SigVerificationDecorator`) are verified, so it is very frequent. - The code is currently disabled, because - if it was needed - secp256k1 pubkey.VerifySignature would return false already. - If something breaks very early on in the game, we might need to revisit enable this code. - More context: https://github.com/0xPolygon/cosmos-sdk/pull/3/#discussion_r1497996133 - https://github.com/0xPolygon/cosmos-sdk/pull/3/#discussion_r1498023925 - - anyPk, _ := codectypes.NewAnyWithValue(pk) - - signerData := txsigning.SignerData{ - Address: acc.GetAddress().String(), - ChainID: ctx.ChainID(), - AccountNumber: acc.GetAccountNumber(), - Sequence: acc.GetSequence(), - PubKey: &anypb.Any{ - TypeUrl: anyPk.TypeUrl, - Value: anyPk.Value, - }, - } - - adaptableTx, ok := tx.(authsigning.V2AdaptableTx) - if !ok { - return ctx, fmt.Errorf("expected tx to implement V2AdaptableTx, got %T", tx) - } - txData := adaptableTx.GetSigningTxData() - recoveredPubKey, err := authsigning.VerifySignature(ctx, pk, signerData, sigs[i].Data, spkd.signModeHandler, txData) - err = acc.SetPubKey(recoveredPubKey) - if err != nil { - return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidPubKey, err.Error()) - } - */ - spkd.ak.SetAccount(ctx, acc) } @@ -370,7 +333,7 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul return ctx, fmt.Errorf("expected tx to implement V2AdaptableTx, got %T", tx) } txData := adaptableTx.GetSigningTxData() - _, err := authsigning.VerifySignature(ctx, pubKey, signerData, sig.Data, svd.signModeHandler, txData) + err := authsigning.VerifySignature(ctx, pubKey, signerData, sig.Data, svd.signModeHandler, txData) if err != nil { var errMsg string diff --git a/x/auth/client/cli/tx_multisign.go b/x/auth/client/cli/tx_multisign.go index 40ddf7feb1ab..b99d601f2a5d 100644 --- a/x/auth/client/cli/tx_multisign.go +++ b/x/auth/client/cli/tx_multisign.go @@ -163,7 +163,7 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) { txData := adaptableTx.GetSigningTxData() if !skipSigVerify { - _, err = signing.VerifySignature(cmd.Context(), sig.PubKey, txSignerData, sig.Data, + err = signing.VerifySignature(cmd.Context(), sig.PubKey, txSignerData, sig.Data, txCfg.SignModeHandler(), txData) if err != nil { addr, _ := sdk.AccAddressFromHex(sig.PubKey.Address().String()) @@ -347,7 +347,7 @@ func makeBatchMultisignCmd() func(cmd *cobra.Command, args []string) error { txData := adaptableTx.GetSigningTxData() for _, sig := range signatureBatch { - _, err = signing.VerifySignature(cmd.Context(), sig[i].PubKey, txSignerData, sig[i].Data, + err = signing.VerifySignature(cmd.Context(), sig[i].PubKey, txSignerData, sig[i].Data, txCfg.SignModeHandler(), txData) if err != nil { return fmt.Errorf("couldn't verify signature: %w %v", err, sig) diff --git a/x/auth/client/cli/validate_sigs.go b/x/auth/client/cli/validate_sigs.go index 88e398ed5826..f9c1fee0e1fe 100644 --- a/x/auth/client/cli/validate_sigs.go +++ b/x/auth/client/cli/validate_sigs.go @@ -148,7 +148,7 @@ func printAndValidateSigs( } txData := adaptableTx.GetSigningTxData() - _, err = authsigning.VerifySignature(cmd.Context(), pubKey, txSignerData, sig.Data, signModeHandler, txData) + err = authsigning.VerifySignature(cmd.Context(), pubKey, txSignerData, sig.Data, signModeHandler, txData) if err != nil { cmd.PrintErrf("failed to verify signature: %v", err) return false diff --git a/x/auth/keeper/deterministic_test.go b/x/auth/keeper/deterministic_test.go index 179bb0f67a72..9244cc9bb5e5 100644 --- a/x/auth/keeper/deterministic_test.go +++ b/x/auth/keeper/deterministic_test.go @@ -116,7 +116,7 @@ func (suite *DeterministicTestSuite) createAndSetAccounts(t *rapid.T, count int) } func (suite *DeterministicTestSuite) TestGRPCQueryAccount() { - suite.T().Skip("TODO HV2: enable and fix this test?") + suite.T().Skip("TODO HV2: fix and enable this test") rapid.Check(suite.T(), func(t *rapid.T) { accs := suite.createAndSetAccounts(t, 1) req := &types.QueryAccountRequest{Address: accs[0].GetAddress().String()} diff --git a/x/auth/signing/verify.go b/x/auth/signing/verify.go index 73c60ef79431..b97f3c4f1f1c 100644 --- a/x/auth/signing/verify.go +++ b/x/auth/signing/verify.go @@ -2,6 +2,7 @@ package signing import ( "context" + "encoding/hex" "fmt" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" @@ -61,31 +62,27 @@ func internalSignModeToAPI(mode signing.SignMode) (signingv1beta1.SignMode, erro // VerifySignature verifies a transaction signature contained in SignatureData abstracting over different signing // modes. It differs from VerifySignature in that it uses the new txsigning.TxData interface in x/tx. -func VerifySignature(ctx context.Context, pubKey cryptotypes.PubKey, signerData txsigning.SignerData, signatureData signing.SignatureData, handler *txsigning.HandlerMap, txData txsigning.TxData) (cryptotypes.PubKey, error) { +func VerifySignature(ctx context.Context, pubKey cryptotypes.PubKey, signerData txsigning.SignerData, signatureData signing.SignatureData, handler *txsigning.HandlerMap, txData txsigning.TxData) error { switch data := signatureData.(type) { case *signing.SingleSignatureData: signMode, err := internalSignModeToAPI(data.SignMode) if err != nil { - return nil, err + return err } signBytes, err := handler.GetSignBytes(ctx, signMode, signerData, txData) if err != nil { - return nil, err + return err } - /* TODO HV2: See comment in `sigverify.go` (relates to https://polygon.atlassian.net/browse/POS-2492). - p, err := RecoverPubKey(signBytes, signatureData.(*signing.SingleSignatureData).Signature) - pubKey = &secp256k1.PubKey{Key: p} - */ if !pubKey.VerifySignature(signBytes, data.Signature) { - return nil, fmt.Errorf("unable to verify single signer signature") + return fmt.Errorf("unable to verify single signer signature '%s' for signBytes '%s'", hex.EncodeToString(data.Signature), hex.EncodeToString(signBytes)) } - return pubKey, nil + return nil case *signing.MultiSignatureData: - return nil, fmt.Errorf("MultiSignatureData not supported in heimdall") + return fmt.Errorf("MultiSignatureData not supported in heimdall") multiPK, ok := pubKey.(multisig.PubKey) if !ok { - return nil, fmt.Errorf("expected %T, got %T", (multisig.PubKey)(nil), pubKey) + return fmt.Errorf("expected %T, got %T", (multisig.PubKey)(nil), pubKey) } err := multiPK.VerifyMultisignature(func(mode signing.SignMode) ([]byte, error) { signMode, err := internalSignModeToAPI(mode) @@ -95,11 +92,11 @@ func VerifySignature(ctx context.Context, pubKey cryptotypes.PubKey, signerData return handler.GetSignBytes(ctx, signMode, signerData, txData) }, data) if err != nil { - return nil, err + return err } - return nil, nil + return nil default: - return nil, fmt.Errorf("unexpected SignatureData %T", signatureData) + return fmt.Errorf("unexpected SignatureData %T", signatureData) } } diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 1b078354e9a4..9b25f17ed963 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -179,11 +179,10 @@ func TestSendNotEnoughBalance(t *testing.T) { []expectedBalance{ {addr3, sdk.Coins{sdk.NewInt64Coin("pol", defaultFeeAmount-1)}}, - // TODO HV2: fee_collector's balance should be 2*defaultFeeAmount but since distribution module - // flushes the fees to the its module account at beginning of the block, - // the fee_collector's balance is 0. - // We should replace the native simapp with a modified version that imitates heimdall as much as possible - // to avoid such discrepancies. + // TODO HV2: https://polygon.atlassian.net/browse/POS-2540 + // fee_collector's balance should be 2*defaultFeeAmount but since distribution module + // flushes the fees to the its module account at beginning of the block, + // the fee_collector's balance is 0. {s.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName), sdk.Coins{}}, }, false, @@ -275,11 +274,10 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { {addr2, sdk.Coins{sdk.NewInt64Coin("pol", 10*defaultFeeAmount)}}, {addr3, sdk.Coins{}}, - // TODO HV2: fee_collector's balance should be defaultFeeAmount but since distribution module - // flushes the fees to the its module account at beginning of the block, - // the fee_collector's balance is 0. - // We should replace the native simapp with a modified version that imitates heimdall as much as possible - // to avoid such discrepancies. + // TODO HV2: https://polygon.atlassian.net/browse/POS-2540: + // fee_collector's balance should be defaultFeeAmount but since distribution module + // flushes the fees to the its module account at beginning of the block, + // the fee_collector's balance is 0. {s.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName), sdk.Coins{}}, }, }, @@ -293,11 +291,10 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { privKeys: []cryptotypes.PrivKey{priv1}, expectedBalances: []expectedBalance{ {addr1, sdk.Coins{sdk.NewInt64Coin("pol", 57*defaultFeeAmount)}}, - // TODO HV2: fee_collector's balance should be defaultFeeAmount but since distribution module - // flushes the fees to the distribution module account at beginning of the block, - // the fee_collector's balance is 0. - // We should replace the native simapp with a modified version that imitates heimdall as much as possible - // to avoid such discrepancies. + // TODO HV2: https://polygon.atlassian.net/browse/POS-2540 + // fee_collector's balance should be defaultFeeAmount but since distribution module + // flushes the fees to the distribution module account at beginning of the block, + // the fee_collector's balance is 0. {s.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName), sdk.Coins{}}, }, }, @@ -313,11 +310,10 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { {addr1, sdk.Coins{sdk.NewInt64Coin("pol", 57*defaultFeeAmount)}}, {addr2, sdk.Coins{sdk.NewInt64Coin("pol", 10*defaultFeeAmount)}}, - // TODO HV2: fee_collector's balance should be defaultFeeAmount but since distribution module - // flushes the fees to the distribution module account at beginning of the block, - // the fee_collector's balance is 0. - // We should replace the native simapp with a modified version that imitates heimdall as much as possible - // to avoid such discrepancies. + // TODO HV2: https://polygon.atlassian.net/browse/POS-2540 + // fee_collector's balance should be defaultFeeAmount but since distribution module + // flushes the fees to the distribution module account at beginning of the block, + // the fee_collector's balance is 0. {s.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName), sdk.Coins{}}, }, }, @@ -436,11 +432,10 @@ func TestMsgMultiSendDependent(t *testing.T) { {addr1, sdk.Coins{sdk.NewInt64Coin("pol", 42*defaultFeeAmount)}}, {addr2, sdk.Coins{}}, - // TODO HV2: fee_collector's balance should be 2*defaultFeeAmount but since distribution module - // flushes the fees to the distribution module account at beginning of the block, - // the fee_collector's balance is 0. - // We should replace the native simapp with a modified version that imitates heimdall as much as possible - // to avoid such discrepancies. + // TODO HV2: https://polygon.atlassian.net/browse/POS-2540 + // fee_collector's balance should be 2*defaultFeeAmount but since distribution module + // flushes the fees to the distribution module account at beginning of the block, + // the fee_collector's balance is 0. {s.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName), sdk.Coins{sdk.NewInt64Coin("pol", defaultFeeAmount)}}, }, }, diff --git a/x/gov/README.md b/x/gov/README.md index 01bb0b5da926..a7987869be29 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -139,8 +139,6 @@ according to the final tally of the proposal. In Heimdall, burn is not enabled, Polygon PoS network, participants are validators. Other holders and users do not get the right to participate in governance. However, they can submit and deposit on proposals. -[//]: # ( TODO HV2: if we don't want non-validators to submit/deposit on proposals, we would need to add an additional check then on gov proposal submission, to validate the proposer is in the active set) - Note that for *participants*, their voting power is calculated from their L1 POL stakes only. #### Voting period diff --git a/x/gov/abci.go b/x/gov/abci.go index c3253fe82755..e8cce5f5a99f 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -46,8 +46,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { return false, err } - // HV2: heimdall always refunds and deletes deposits in all cases of proposal failures, without caring about params.BurnProposalDepositPrevote - // TODO HV2: enable some anti-spam mechanism (e.g. burn deposits or send them to the feeCollector)? + // TODO HV2: https://polygon.atlassian.net/browse/POS-2755 err = keeper.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal if err != nil { return false, err diff --git a/x/gov/module.go b/x/gov/module.go index 01006ab851ed..fb86ca65d07e 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -47,9 +47,6 @@ var ( _ appmodule.AppModule = AppModule{} _ appmodule.HasEndBlocker = AppModule{} - - // TODO HV2: from heimdall. I don't think it's needed. To double check and eventually remove - // _ hmModule.HeimdallModuleBasic = AppModule{} ) // AppModuleBasic defines the basic application module used by the gov module. diff --git a/x/upgrade/types/proposal.go b/x/upgrade/types/proposal.go index f40b5a4e15ca..ebac9a18eb29 100644 --- a/x/upgrade/types/proposal.go +++ b/x/upgrade/types/proposal.go @@ -5,12 +5,6 @@ import ( ) const ( - /* TODO HV2: ProposalTypeSoftwareUpgrade was removed. What to do with it? - ProposalTypeCancelSoftwareUpgrade was not even there in heimdall's gov/types/proposal.go. - Also, ProposalTypeCancelSoftwareUpgrade depends on ProposalTypeSoftwareUpgrade semantically, - so whatever we do with one, we should do with the other. - */ - ProposalTypeSoftwareUpgrade string = "SoftwareUpgrade" ProposalTypeCancelSoftwareUpgrade string = "CancelSoftwareUpgrade" )