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

fix: increase unauthenticated gas to fix fee token issue #8573

Merged
merged 3 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#8535](https://github.com/osmosis-labs/osmosis/pull/8535) Prevent Setting Invalid Before Send Hook
* [#8310](https://github.com/osmosis-labs/osmosis/pull/8310) Taker fee share
* [#8494](https://github.com/osmosis-labs/osmosis/pull/8494) Add additional events in x/lockup, x/superfluid, x/concentratedliquidity
* [#8573](https://github.com/osmosis-labs/osmosis/pull/8573) fix: increase unauthenticated gas to fix fee token issue

### Config

Expand Down
7 changes: 6 additions & 1 deletion app/upgrades/v26/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import (
)

// UpgradeName defines the on-chain upgrade name for the Osmosis v26 upgrade.
const UpgradeName = "v26"
const (
UpgradeName = "v26"

// MaximumUnauthenticatedGas for smart account transactions to verify the fee payer
MaximumUnauthenticatedGas = uint64(200_000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this higher, e.g. 300k to 500k

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I defo want to keep this as low as possible, I bumped to 250k, I think if we reach this, we need to optimise the authentication flow not increase gas

)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
Expand Down
5 changes: 5 additions & 0 deletions app/upgrades/v26/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func CreateUpgradeHandler(
keepers.PoolManagerKeeper.SetDenomPairTakerFee(ctx, tradingPairTakerFee.TokenOutDenom, tradingPairTakerFee.TokenInDenom, tradingPairTakerFee.TakerFee)
}

// Set the authenticator params in the store
authenticatorParams := keepers.SmartAccountKeeper.GetParams(ctx)
authenticatorParams.MaximumUnauthenticatedGas = MaximumUnauthenticatedGas
keepers.SmartAccountKeeper.SetParams(ctx, authenticatorParams)

return migrations, nil
}
}
14 changes: 14 additions & 0 deletions app/upgrades/v26/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (s *UpgradeTestSuite) TestUpgrade() {
s.preModule = upgrade.NewAppModule(s.App.UpgradeKeeper, addresscodec.NewBech32Codec("osmo"))

s.PrepareTradingPairTakerFeeTest()
s.PrepareIncreaseUnauthenticatedGasTest()

// Run the upgrade
dummyUpgrade(s)
Expand All @@ -57,6 +58,7 @@ func (s *UpgradeTestSuite) TestUpgrade() {
})

s.ExecuteTradingPairTakerFeeTest()
s.ExecuteIncreaseUnauthenticatedGasTest()
}

func dummyUpgrade(s *UpgradeTestSuite) {
Expand Down Expand Up @@ -101,3 +103,15 @@ func (s *UpgradeTestSuite) ExecuteTradingPairTakerFeeTest() {
s.Require().Len(allTradingPairTakerFees, 4)
s.Require().Equal(expectedTradingPairTakerFees, allTradingPairTakerFees)
}

func (s *UpgradeTestSuite) PrepareIncreaseUnauthenticatedGasTest() {
// Set the unauthenticator gas parameter to 1
authenticatorParams := s.App.SmartAccountKeeper.GetParams(s.Ctx)
authenticatorParams.MaximumUnauthenticatedGas = 1
s.App.SmartAccountKeeper.SetParams(s.Ctx, authenticatorParams)
}

func (s *UpgradeTestSuite) ExecuteIncreaseUnauthenticatedGasTest() {
authenticatorParams := s.App.SmartAccountKeeper.GetParams(s.Ctx)
s.Require().Equal(authenticatorParams.MaximumUnauthenticatedGas, v26.MaximumUnauthenticatedGas)
}