-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vbank): new param
allowed_monitoring_accounts
(#10488)
closes: #8564 ## Description To make the Golang `x/vbank` more flexible, introduce an `allowed_monitoring_accounts` parameter. The default at agd genesis, or when an existing chain does a software-upgrade to this agd, will prevent balance monitoring except to the `vbank/provision` module account (`"agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346"`, according to `packages/internal/src/config.js`). This provisioning account's balances need to be monitored for normal operation of `packages/inter-protocol/src/provisionPoolKit.js`. This restriction will prevent the cause of #8564 (that the vast majority of balance monitoring updates were to the `vbank/reserve` module account, which did nothing with them), while making it possible to reënable balance updates when they can be reworked and deemed harmless. ### Security Considerations n/a ### Scaling Considerations Improves scalability if the chain is dealing with Cosmos x/bank sends (which are also triggered by IBC transfers) among many different accounts. ### Documentation Considerations n/a ### Testing Considerations The `"*"` wildcard-all short-circuit is not tested yet. ### Upgrade Considerations No JS changes, and preserving backward compatibility in the bridge messages, so this should be safe to upgrade.
- Loading branch information
Showing
10 changed files
with
250 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package keeper | ||
|
||
import ( | ||
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vbank/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// Migrator handles in-place store migrations. | ||
type Migrator struct { | ||
keeper Keeper | ||
} | ||
|
||
// NewMigrator creates a new Migrator based on the keeper. | ||
func NewMigrator(keeper Keeper) Migrator { | ||
return Migrator{keeper: keeper} | ||
} | ||
|
||
// Migrate1to2 migrates from version 1 to 2. | ||
func (m Migrator) Migrate1to2(ctx sdk.Context) error { | ||
params := m.keeper.GetParams(ctx) | ||
if params.AllowedMonitoringAccounts != nil { | ||
return nil | ||
} | ||
|
||
defaultParams := types.DefaultParams() | ||
params.AllowedMonitoringAccounts = defaultParams.AllowedMonitoringAccounts | ||
m.keeper.SetParams(ctx, params) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.