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

refactor: remove global valaddress bech32 codec calls (1/2) (backport #17098) #17149

Merged
merged 3 commits into from
Jul 26, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 26, 2023

This is an automatic backport of pull request #17098 done by Mergify.
Cherry-pick of 58855c6 has failed:

On branch mergify/bp/release/v0.50.x/pr-17098
Your branch is up to date with 'origin/release/v0.50.x'.

You are currently cherry-picking commit 58855c685.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   simapp/simd/cmd/testnet.go
	modified:   tests/e2e/authz/tx.go
	modified:   tests/e2e/distribution/suite.go
	modified:   tests/e2e/distribution/withdraw_all_suite.go
	modified:   tests/e2e/staking/suite.go
	modified:   tests/e2e/staking/test_helpers.go
	modified:   tests/integration/distribution/keeper/msg_server_test.go
	modified:   tests/integration/gov/keeper/common_test.go
	modified:   tests/integration/staking/keeper/genesis_test.go
	modified:   tests/integration/staking/keeper/grpc_query_test.go
	modified:   tests/integration/staking/keeper/msg_server_test.go
	modified:   tests/integration/staking/keeper/slash_test.go
	modified:   testutil/network/network.go
	modified:   testutil/network/util.go
	modified:   x/auth/migrations/v2/store_test.go
	modified:   x/distribution/client/cli/tx.go
	modified:   x/distribution/client/cli/tx_test.go
	modified:   x/distribution/keeper/allocation.go
	modified:   x/distribution/keeper/allocation_test.go
	modified:   x/distribution/keeper/grpc_query.go
	modified:   x/distribution/keeper/msg_server.go
	modified:   x/distribution/module.go
	modified:   x/distribution/simulation/operations.go
	modified:   x/distribution/simulation/operations_test.go
	modified:   x/distribution/testutil/staking_helper.go
	modified:   x/distribution/types/msg.go
	modified:   x/genutil/client/cli/collect.go
	modified:   x/genutil/client/cli/commands.go
	modified:   x/genutil/client/cli/genaccount.go
	modified:   x/genutil/client/cli/genaccount_test.go
	modified:   x/genutil/client/cli/gentx.go
	modified:   x/genutil/client/cli/gentx_test.go
	modified:   x/genutil/collect.go
	modified:   x/genutil/collect_test.go
	modified:   x/genutil/gentx_test.go
	modified:   x/genutil/types/genesis_state_test.go
	modified:   x/gov/abci_test.go
	modified:   x/gov/keeper/hooks_test.go
	modified:   x/gov/keeper/tally.go
	modified:   x/gov/testutil/expected_keepers_mocks.go
	modified:   x/gov/types/expected_keepers.go
	modified:   x/slashing/app_test.go
	modified:   x/slashing/client/cli/tx.go
	modified:   x/slashing/client/cli/tx_test.go
	modified:   x/slashing/keeper/hooks_test.go
	modified:   x/slashing/keeper/keeper_test.go
	modified:   x/slashing/keeper/msg_server.go
	modified:   x/slashing/keeper/msg_server_test.go
	modified:   x/slashing/module.go
	modified:   x/slashing/simulation/operations.go
	modified:   x/slashing/simulation/operations_test.go
	modified:   x/slashing/testutil/expected_keepers_mocks.go
	modified:   x/slashing/types/expected_keepers.go
	modified:   x/slashing/types/msg.go
	modified:   x/slashing/types/msg_test.go
	modified:   x/staking/app_test.go
	modified:   x/staking/client/cli/flags.go
	modified:   x/staking/client/cli/tx.go
	modified:   x/staking/client/cli/tx_test.go
	modified:   x/staking/keeper/delegation.go
	modified:   x/staking/keeper/delegation_test.go
	modified:   x/staking/keeper/genesis.go
	modified:   x/staking/keeper/grpc_query.go
	modified:   x/staking/keeper/invariants.go
	modified:   x/staking/keeper/msg_server.go
	modified:   x/staking/keeper/msg_server_test.go
	modified:   x/staking/keeper/query_utils.go
	modified:   x/staking/keeper/slash.go
	modified:   x/staking/keeper/unbonding.go
	modified:   x/staking/keeper/unbonding_test.go
	modified:   x/staking/keeper/val_state_change.go
	modified:   x/staking/keeper/validator.go
	modified:   x/staking/module.go
	modified:   x/staking/simulation/genesis.go
	modified:   x/staking/simulation/operations.go
	modified:   x/staking/simulation/operations_test.go
	modified:   x/staking/testutil/helpers.go
	modified:   x/staking/types/authz_test.go
	modified:   x/staking/types/delegation.go
	modified:   x/staking/types/delegation_test.go
	modified:   x/staking/types/msg.go
	modified:   x/staking/types/msg_test.go
	modified:   x/staking/types/validator.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   CHANGELOG.md
	both modified:   tests/integration/staking/keeper/validator_test.go
	deleted by us:   testutil/testnet/genesis.go
	both modified:   x/distribution/keeper/genesis.go
	deleted by us:   x/gov/keeper/tally_test.go
	both modified:   x/staking/simulation/decoder_test.go
	both modified:   x/staking/testutil/validator.go
	both modified:   x/staking/types/validator_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

Co-authored-by: Devon Bear <itsdevbear@berachain.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit 58855c6)

# Conflicts:
#	CHANGELOG.md
#	tests/integration/staking/keeper/validator_test.go
#	testutil/testnet/genesis.go
#	x/distribution/keeper/genesis.go
#	x/gov/keeper/tally_test.go
#	x/staking/simulation/decoder_test.go
#	x/staking/testutil/validator.go
#	x/staking/types/validator_test.go
@@ -53,9 +53,14 @@
// NOTE: Correctness dependent on invariant that unbonding delegations / redelegations must also have been completely
// slashed in this case - which we don't explicitly check, but should be true.
// Log the slash attempt for future reference (maybe we should tag it too)
conStr, err := k.consensusAddressCodec.BytesToString(consAddr)
if err != nil {
panic(err)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@@ -170,9 +175,13 @@
panic("invalid validator status")
}

valAddr, err := k.validatorAddressCodec.BytesToString(validator.GetOperator())
if err != nil {
panic(err)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
x/distribution/keeper/genesis.go Fixed Show fixed Hide fixed
x/distribution/keeper/genesis.go Fixed Show fixed Hide fixed
@julienrbrt julienrbrt merged commit 46be66e into release/v0.50.x Jul 26, 2023
@julienrbrt julienrbrt deleted the mergify/bp/release/v0.50.x/pr-17098 branch July 26, 2023 22:55
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants