Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
v009 "github.com/Asphere-xyz/tacchain/app/upgrades/v0.0.9"
v101 "github.com/Asphere-xyz/tacchain/app/upgrades/v1.0.1"
v102 "github.com/Asphere-xyz/tacchain/app/upgrades/v1.0.2"
v103 "github.com/Asphere-xyz/tacchain/app/upgrades/v1.0.3"
)

// Upgrades list of chain upgrades
Expand All @@ -20,6 +21,7 @@ var Upgrades = []upgrades.Upgrade{
v0011.Upgrade,
v101.Upgrade,
v102.Upgrade, // liquid stake
v103.Upgrade, // ed25519 precompile
}

// RegisterUpgradeHandlers registers the chain upgrade handlers
Expand All @@ -36,6 +38,7 @@ func (app *TacChainApp) RegisterUpgradeHandlers() {
BankKeeper: app.BankKeeper,
Erc20Keeper: &app.Erc20Keeper,
StakingKeeper: app.StakingKeeper,
EVMKeeper: app.EVMKeeper,
}
app.GetStoreKeys()
// register all upgrade handlers
Expand Down
3 changes: 3 additions & 0 deletions app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
evmerc20keeper "github.com/cosmos/evm/x/erc20/keeper"
liquidstakekeeper "github.com/cosmos/evm/x/liquidstake/keeper"

evmvmkeeper "github.com/cosmos/evm/x/vm/keeper"
)

type AppKeepers struct {
Expand All @@ -33,6 +35,7 @@ type AppKeepers struct {
BankKeeper bankkeeper.Keeper
Erc20Keeper *evmerc20keeper.Keeper
StakingKeeper *stakingkeeper.Keeper
EVMKeeper *evmvmkeeper.Keeper
}

type ModuleManager interface {
Expand Down
48 changes: 48 additions & 0 deletions app/upgrades/v1.0.3/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package v103

import (
"context"
"slices"

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/Asphere-xyz/tacchain/app/upgrades"
"github.com/cosmos/cosmos-sdk/types/module"

evmtypes "github.com/cosmos/evm/x/vm/types"
)

const UpgradeName = "v1.0.3"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: storetypes.StoreUpgrades{},
}

func CreateUpgradeHandler(
mm upgrades.ModuleManager,
configurator module.Configurator,
ak *upgrades.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
vm, err := mm.RunMigrations(ctx, configurator, fromVM)
if err != nil {
return vm, err
}

sdkCtx := sdk.UnwrapSDKContext(ctx)

evmParams := ak.EVMKeeper.GetParams(sdkCtx)
target := evmtypes.Ed25519PrecompileAddress
if !slices.Contains(evmParams.ActiveStaticPrecompiles, target) {
evmParams.ActiveStaticPrecompiles = append(evmParams.ActiveStaticPrecompiles, target)
if err := ak.EVMKeeper.SetParams(sdkCtx, evmParams); err != nil {
return vm, err
}
}
return vm, nil
}
}
17 changes: 16 additions & 1 deletion contrib/localnet/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,22 @@ sed -i.bak "s/\"allow_unprotected_txs\": false/\"allow_unprotected_txs\": true/g
sed -i.bak "s/allow-unprotected-txs = false/allow-unprotected-txs = true/g" $HOMEDIR/config/app.toml

# set evm precompiles
sed -i.bak "s/\"active_static_precompiles\": \[\]/\"active_static_precompiles\": \[\"0x0000000000000000000000000000000000000100\",\"0x0000000000000000000000000000000000000400\",\"0x0000000000000000000000000000000000000800\",\"0x0000000000000000000000000000000000000801\",\"0x0000000000000000000000000000000000000802\",\"0x0000000000000000000000000000000000000803\",\"0x0000000000000000000000000000000000000804\",\"0x0000000000000000000000000000000000000805\",\"0x0000000000000000000000000000000000000806\",\"0x0000000000000000000000000000000000000807\", \"0x0000000000000000000000000000000000001600\"\]/g" $HOMEDIR/config/genesis.json
jq '
.app_state.evm.params.active_static_precompiles = [
"0x0000000000000000000000000000000000000100",
"0x0000000000000000000000000000000000000400",
"0x0000000000000000000000000000000000000800",
"0x0000000000000000000000000000000000000801",
"0x0000000000000000000000000000000000000802",
"0x0000000000000000000000000000000000000803",
"0x0000000000000000000000000000000000000804",
"0x0000000000000000000000000000000000000805",
"0x0000000000000000000000000000000000000806",
"0x0000000000000000000000000000000000000807",
"0x00000000000000000000000000000000000008f3",
"0x0000000000000000000000000000000000001600"
]
' "$HOMEDIR/config/genesis.json" > "$HOMEDIR/config/genesis_patched.json" && mv "$HOMEDIR/config/genesis_patched.json" "$HOMEDIR/config/genesis.json"

# set x/feemarket min gas price
sed -i.bak "s/\"min_gas_price\": \"0.000000000000000000\"/\"min_gas_price\": \"$MIN_GAS_PRICE\"/g" $HOMEDIR/config/genesis.json
Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,11 @@ replace (
// replace to cosmos-sdk fork for liquid stake support. See: https://github.com/TacBuild/cosmos-sdk/pull/2
github.com/cosmos/cosmos-sdk => github.com/TacBuild/cosmos-sdk v0.0.0-20251010131633-e43d8d10a9a9

// replace to cosmos/evm fork for liquid stake support. See: https://github.com/TacBuild/evm/pull/9
github.com/cosmos/evm => github.com/TacBuild/evm v0.0.0-20251010145635-9055209fc1d5
// replace to cosmos/evm fork
// added liquid stake support. See: https://github.com/TacBuild/evm/pull/9
// added ed25519 precompile support. See: https://github.com/TacBuild/evm/pull/8
// fix liquid stake espilon. See: https://github.com/TacBuild/evm/pull/10
github.com/cosmos/evm => github.com/TacBuild/evm v0.0.0-20251030120744-79ed002a3490

// replace with our fork using geth v1.13.15
github.com/ethereum/go-ethereum => github.com/TacBuild/go-ethereum v0.0.0-20250428082551-b4f5a8f8420a
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDO
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/TacBuild/cosmos-sdk v0.0.0-20251010131633-e43d8d10a9a9 h1:jMjIlOrdA+vBfZkuljd7V/54L1az5n3Sw12iE7Pea00=
github.com/TacBuild/cosmos-sdk v0.0.0-20251010131633-e43d8d10a9a9/go.mod h1:0Fo5FGFsiXxRRrVm7hBwxzwCeHhNxFPIMUSXqe9P8aA=
github.com/TacBuild/evm v0.0.0-20251010145635-9055209fc1d5 h1:ALJ3HjJscsYgDCFHKF4lCE5yx1cvWyvLbb2CjOOAhyQ=
github.com/TacBuild/evm v0.0.0-20251010145635-9055209fc1d5/go.mod h1:9+gL3zGzrGuh1oF5vfFl7kuswgma6v7IN0KDbBmO0eA=
github.com/TacBuild/evm v0.0.0-20251030120744-79ed002a3490 h1:3obQEWEzVE4yrdskdDXAEoySEsfyc/8JP+zbJCiTflE=
github.com/TacBuild/evm v0.0.0-20251030120744-79ed002a3490/go.mod h1:9+gL3zGzrGuh1oF5vfFl7kuswgma6v7IN0KDbBmO0eA=
github.com/TacBuild/go-ethereum v0.0.0-20250428082551-b4f5a8f8420a h1:d5s3in80qbAEpMLo2gVHKPrR6qn60nyxV+rK17tqZ1Q=
github.com/TacBuild/go-ethereum v0.0.0-20250428082551-b4f5a8f8420a/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU=
github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40=
Expand Down
1 change: 1 addition & 0 deletions tests/localnet/test-params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ expected_evm_params='{
"0x0000000000000000000000000000000000000805",
"0x0000000000000000000000000000000000000806",
"0x0000000000000000000000000000000000000807",
"0x00000000000000000000000000000000000008f3",
"0x0000000000000000000000000000000000001600"
]
}'
Expand Down
Loading