-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Upgrade] Softfork for WASM Updates (#433)
* add softfork condition to staking wasm querier * formatting * update error codes bigger than 1 * handle prev error to internal error * handle prev error to internal error * fix wrong error type * add wasm execute msg size limit update * remove unstable staking begin blocker
- Loading branch information
yys
authored
Nov 23, 2020
1 parent
df11740
commit ee1cd6e
Showing
20 changed files
with
131 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package util | ||
|
||
import sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
// IsWaitingForSoftfork returns whether current block | ||
// height is bigger than reserved softfork block height | ||
func IsWaitingForSoftfork(ctx sdk.Context, _version uint8) bool { | ||
// Expected time: | ||
// MAINNET | ||
// Fri Jan 01 2021 18:00:00 GMT+0900 (KST) | ||
// Fri Jan 01 2021 09:00:00 GMT+0000 (UTC) | ||
// Fri Jan 01 2021 01:00:00 GMT-0800 (PST) | ||
// | ||
// TEQUILA | ||
// Fri Nov 27 2020 12:00:00 GMT+0900 (KST) | ||
// Fri Nov 27 2020 03:00:00 GMT+0000 (UTC) | ||
// Fri Nov 26 2020 19:00:00 GMT-0800 (KST) | ||
|
||
return (ctx.ChainID() == "columbus-4" && ctx.BlockHeight() < 1200000) || | ||
(ctx.ChainID() == "tequila-0004" && ctx.BlockHeight() < 1350000) | ||
} | ||
|
||
// IsSoftforkHeight return whether current block | ||
// height is the targeted softfork height | ||
func IsSoftforkHeight(ctx sdk.Context, _version uint8) bool { | ||
return (ctx.ChainID() == "columbus-4" && ctx.BlockHeight() == 1200000) || | ||
(ctx.ChainID() == "tequila-0004" && ctx.BlockHeight() == 1350000) | ||
} |
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
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
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 was deleted.
Oops, something went wrong.
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,17 @@ | ||
package wasm | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
core "github.com/terra-project/core/types" | ||
"github.com/terra-project/core/x/wasm/internal/keeper" | ||
) | ||
|
||
// BeginBlocker handles softfork over param changes | ||
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { | ||
if core.IsSoftforkHeight(ctx, 1) { | ||
params := k.GetParams(ctx) | ||
params.MaxContractMsgSize = 4096 | ||
k.SetParams(ctx, params) | ||
} | ||
} |
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
Oops, something went wrong.