Skip to content
Draft
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
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,18 @@ jobs:
check-latest: true
- run: make install
- run: make test-solidity

test-wasmd:
runs-on: ubuntu-latest
needs: test-build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.6"
check-latest: true
- run: go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
- run: sudo apt-get update && sudo apt-get install -y xxd
- run: make install
- run: make test-wasmd
timeout-minutes: 3
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ coverage.txt
.testnet
.test-localnet-params
.test-localnet-evm
.test-wasmd
.mainnet

# babylon
.babylond
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@ RUN set -eux; apk add --no-cache ca-certificates build-base libusb-dev linux-hea
WORKDIR /code
COPY . /code/

RUN LEDGER_ENABLED=true make build
# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.2.3/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.2.3/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 6641730781bb1adc4bdf04a1e0f822b9ad4fb8ed57dcbbf575527e63b791ae41
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 32503fe35a7be202c5f7c3051497d6e4b3cd83079a61f5a0bf72a2a455b6d820

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=true BUILD_TAGS=muslc LINK_STATICALLY=true make build
RUN echo "Ensuring binary is statically linked ..." \
&& (file /code/build/tacchaind | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.18

RUN apk update && apk add bash jq

COPY --from=go-builder /code/build/tacchaind /usr/bin/tacchaind

WORKDIR /opt
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=tacchain \
ifeq ($(WITH_CLEVELDB),yes)
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
endif
ifeq ($(LINK_STATICALLY),true)
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
endif
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

Expand Down Expand Up @@ -92,7 +95,7 @@ clean:
### Tests ###
###############################################################################

test: test-unit test-race test-e2e test-localnet-params test-localnet-evm test-ledger test-solidity
test: test-unit test-race test-e2e test-localnet-params test-localnet-evm test-ledger test-solidity test-wasmd

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' -v $(shell go list ./... | grep -v "tests")
Expand Down Expand Up @@ -121,6 +124,9 @@ test-ledger:
test-solidity:
./tests/solidity/run-solidity-tests.sh

test-wasmd:
./tests/wasmd/test-wasmd.sh

###############################################################################
### Networks ###
###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion NETWORKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ tacchaind start --chain-id tacchain_239-1 --home .mainnet

``` shell
export TAC_HOME="~/.tacchain"
export VERSION="v1.0.0"
export VERSION="v1.0.1"

git clone https://github.com/TacBuild/tacchain.git && cd tacchain
git checkout ${VERSION}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tac Chain

`tacchaind` is a TAC EVM Node based on CosmosSDK with EVM support.
`tacchaind` is a TAC EVM Node based on CosmosSDK with EVM and WASM support.

### Quickstart

Expand Down Expand Up @@ -40,4 +40,5 @@ Check our [tool](./contrib/tac-address-converter/) for converting between EVM <>

- [Cosmos SDK docs](https://docs.cosmos.network)
- [CosmosEVM docs](https://evm.cosmos.network/)
- [CosmWasm docs](https://docs.cosmwasm.com/)

22 changes: 21 additions & 1 deletion app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ import (
evmante "github.com/cosmos/evm/ante/evm"
evmanteinterfaces "github.com/cosmos/evm/ante/interfaces"
evmtypes "github.com/cosmos/evm/x/vm/types"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper and Ethermint keeper.
// channel keeper, CosmWasm keeper and cosmosevm keeper.
type HandlerOptions struct {
authante.HandlerOptions

Expand All @@ -37,6 +40,10 @@ type HandlerOptions struct {
FeeMarketKeeper evmanteinterfaces.FeeMarketKeeper
EvmKeeper evmanteinterfaces.EVMKeeper
MaxTxGasWanted uint64

// CosmWasm
WasmConfig *wasmtypes.NodeConfig
WasmKeeper *wasmkeeper.Keeper
}

// NewAnteHandler returns an ante handler responsible for attempting to route an
Expand All @@ -62,6 +69,15 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.EvmKeeper == nil {
return nil, errors.New("evm keeper is required for ante builder")
}
if options.TXCounterStoreService == nil {
return nil, errors.New("wasm store service is required for ante builder")
}
if options.WasmConfig == nil {
return nil, errors.New("wasm config is required for ante builder")
}
if options.WasmKeeper == nil {
return nil, errors.New("wasm keeper is required for ante builder")
}

return func(
ctx sdk.Context, tx sdk.Tx, sim bool,
Expand Down Expand Up @@ -122,6 +138,10 @@ func newCosmosAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
sdk.MsgTypeURL(&sdkvesting.MsgCreateVestingAccount{}),
),
authante.NewSetUpContextDecorator(),
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
wasmkeeper.NewTxContractsDecorator(),
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
authante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
authante.NewValidateBasicDecorator(),
Expand Down
Loading
Loading