Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/zeta-chain/node into fea…
Browse files Browse the repository at this point in the history
…t-Solana-RPC-status-and-refactor
  • Loading branch information
ws4charlie committed Aug 30, 2024
2 parents 826da7b + 91c323d commit d27d32a
Show file tree
Hide file tree
Showing 206 changed files with 4,200 additions and 1,641 deletions.
66 changes: 16 additions & 50 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,10 @@ on:
- cron: "0 6 * * *"
workflow_dispatch:
inputs:
default-test:
type: boolean
required: false
default: false
upgrade-light-test:
type: boolean
required: false
default: false
upgrade-test:
type: boolean
required: false
default: false
admin-test:
type: boolean
required: false
default: false
upgrade-import-mainnet-test:
type: boolean
required: false
default: false
performance-test:
type: boolean
required: false
default: false
stateful-data-test:
type: boolean
required: false
default: false
tss-migration-test:
type: boolean
required: false
default: false
solana-test:
type: boolean
required: false
default: false
v2-test:
type: boolean
required: false
default: false
make-targets:
description: 'Comma separated list of make targets to run (without the start- prefix)'
required: true
default: ''

concurrency:
group: e2e-${{ github.head_ref || github.sha }}
Expand Down Expand Up @@ -124,16 +88,17 @@ jobs:
core.setOutput('SOLANA_TESTS', true);
core.setOutput('V2_TESTS', true); // for v2 tests, TODO: remove this once we fully migrate to v2 (https://github.com/zeta-chain/node/issues/2627)
} else if (context.eventName === 'workflow_dispatch') {
core.setOutput('DEFAULT_TESTS', context.payload.inputs['default-test']);
core.setOutput('UPGRADE_TESTS', context.payload.inputs['upgrade-test']);
core.setOutput('UPGRADE_LIGHT_TESTS', context.payload.inputs['upgrade-light-test']);
core.setOutput('UPGRADE_IMPORT_MAINNET_TESTS', context.payload.inputs['upgrade-import-mainnet-test']);
core.setOutput('ADMIN_TESTS', context.payload.inputs['admin-test']);
core.setOutput('PERFORMANCE_TESTS', context.payload.inputs['performance-test']);
core.setOutput('STATEFUL_DATA_TESTS', context.payload.inputs['stateful-data-test']);
core.setOutput('TSS_MIGRATION_TESTS', context.payload.inputs['tss-migration-test']);
core.setOutput('SOLANA_TESTS', context.payload.inputs['solana-test']);
core.setOutput('V2_TESTS', context.payload.inputs['v2-test']); // for v2 tests, TODO: remove this once we fully migrate to v2 (https://github.com/zeta-chain/node/issues/2627)
const makeTargets = context.payload.inputs['make-targets'].split(',');
core.setOutput('DEFAULT_TESTS', makeTargets.includes('default-test'));
core.setOutput('UPGRADE_TESTS', makeTargets.includes('upgrade-test'));
core.setOutput('UPGRADE_LIGHT_TESTS', makeTargets.includes('upgrade-test-light'));
core.setOutput('UPGRADE_IMPORT_MAINNET_TESTS', makeTargets.includes('upgrade-import-mainnet-test'));
core.setOutput('ADMIN_TESTS', makeTargets.includes('admin-test'));
core.setOutput('PERFORMANCE_TESTS', makeTargets.includes('performance-test'));
core.setOutput('STATEFUL_DATA_TESTS', makeTargets.includes('import-mainnet-test'));
core.setOutput('TSS_MIGRATION_TESTS', makeTargets.includes('tss-migration-test'));
core.setOutput('SOLANA_TESTS', makeTargets.includes('solana-test'));
core.setOutput('V2_TESTS', makeTargets.includes('v2-test')); // for v2 tests, TODO: remove this once we fully migrate to v2 (https://github.com/zeta-chain/node/issues/2627)
}
e2e:
Expand Down Expand Up @@ -168,6 +133,7 @@ jobs:
- make-target: "start-tss-migration-test"
runs-on: ubuntu-20.04
run: ${{ needs.matrix-conditionals.outputs.TSS_MIGRATION_TESTS == 'true' }}
timeout-minutes: 40
- make-target: "start-solana-test"
runs-on: ubuntu-20.04
run: ${{ needs.matrix-conditionals.outputs.SOLANA_TESTS == 'true' }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/generate-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
run: |
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Install solc-select
run: |
pip3 install solc-select
- name: Generate Go code, docs and specs
env:
TEST_ENV: ${{ github.workspace }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-localnet
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN --mount=type=cache,target="/root/.cache/go-build" make install
RUN --mount=type=cache,target="/root/.cache/go-build" make install-zetae2e

FROM ghcr.io/zeta-chain/golang:1.22.5-bookworm AS cosmovisor-build
RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.6.0

FROM ghcr.io/zeta-chain/golang:1.22.5-bookworm AS base-runtime

Expand Down
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.PHONY: build

PACKAGE_NAME := github.com/zeta-chain/node
VERSION := $(shell ./version.sh)
COMMIT := $(shell [ -z "${COMMIT_ID}" ] && git log -1 --format='%H' || echo ${COMMIT_ID} )
BUILDTIME := $(shell date -u +"%Y%m%d.%H%M%S" )
Expand All @@ -8,7 +9,9 @@ DOCKER ?= docker
# useful for setting profiles
DOCKER_COMPOSE ?= $(DOCKER) compose $(COMPOSE_ARGS)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
GOFLAGS:=""
GOFLAGS := ""
GOLANG_CROSS_VERSION ?= v1.22.4
GOPATH ?= '$(HOME)/go'

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=zetacore \
-X github.com/cosmos/cosmos-sdk/version.ServerName=zetacored \
Expand All @@ -23,7 +26,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=zetacore \

BUILD_FLAGS := -ldflags '$(ldflags)' -tags pebbledb,ledger

TEST_DIR?="./..."
TEST_DIR ?= "./..."
TEST_BUILD_FLAGS := -tags pebbledb,ledger
HSM_BUILD_FLAGS := -tags pebbledb,ledger,hsm_test

Expand Down Expand Up @@ -53,11 +56,11 @@ go.sum: go.mod
### Test commands ###
###############################################################################

test: clean-test-dir run-test

run-test:
@go test ${TEST_BUILD_FLAGS} ${TEST_DIR}

test :clean-test-dir run-test

test-hsm:
@go test ${HSM_BUILD_FLAGS} ${TEST_DIR}

Expand Down Expand Up @@ -199,8 +202,13 @@ mocks:
@bash ./scripts/mocks-generate.sh
.PHONY: mocks

precompiles:
@echo "--> Generating bindings for precompiled contracts"
@bash ./scripts/bindings-stateful-precompiles.sh
.PHONY: precompiles

# generate also includes Go code formatting
generate: proto-gen openapi specs typescript docs-zetacored mocks fmt
generate: proto-gen openapi specs typescript docs-zetacored mocks precompiles fmt
.PHONY: generate


Expand Down Expand Up @@ -262,7 +270,8 @@ start-stress-test: zetanode
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile stress -f docker-compose.yml up -d

start-tss-migration-test: zetanode
@echo "--> Starting migration test"
@echo "--> Starting tss migration test"
export LOCALNET_MODE=tss-migrate && \
export E2E_ARGS="--test-tss-migration" && \
cd contrib/localnet/ && $(DOCKER_COMPOSE) up -d

Expand Down Expand Up @@ -293,7 +302,6 @@ zetanode-upgrade: zetanode
.PHONY: zetanode-upgrade
endif


start-upgrade-test: zetanode-upgrade
@echo "--> Starting upgrade test"
export LOCALNET_MODE=upgrade && \
Expand All @@ -306,7 +314,6 @@ start-upgrade-test-light: zetanode-upgrade
export UPGRADE_HEIGHT=90 && \
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d


start-upgrade-test-admin: zetanode-upgrade
@echo "--> Starting admin upgrade test"
export LOCALNET_MODE=upgrade && \
Expand All @@ -326,9 +333,6 @@ start-upgrade-import-mainnet-test: zetanode-upgrade
### GoReleaser ###
###############################################################################

PACKAGE_NAME := github.com/zeta-chain/node
GOLANG_CROSS_VERSION ?= v1.22.4
GOPATH ?= '$(HOME)/go'
release-dry-run:
docker run \
--rm \
Expand Down
2 changes: 1 addition & 1 deletion app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
// along with the Ethermint library. If not, see https://github.com/zeta-chain/ethermint/blob/main/LICENSE
package ante

import (
Expand Down
4 changes: 2 additions & 2 deletions app/ante/fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
// along with the Ethermint library. If not, see https://github.com/zeta-chain/ethermint/blob/main/LICENSE

// Copyright 2023 ZetaChain
// modified to exclude gentx transaction type from the min gas price check
Expand All @@ -26,7 +26,7 @@ import (
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ethtypes "github.com/ethereum/go-ethereum/core/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
// along with the Ethermint library. If not, see https://github.com/zeta-chain/ethermint/blob/main/LICENSE

package ante

Expand All @@ -29,9 +29,9 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
ethante "github.com/evmos/ethermint/app/ante"
ethermint "github.com/evmos/ethermint/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
ethante "github.com/zeta-chain/ethermint/app/ante"
ethermint "github.com/zeta-chain/ethermint/types"
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"

observerkeeper "github.com/zeta-chain/zetacore/x/observer/keeper"
)
Expand Down
11 changes: 5 additions & 6 deletions app/ante/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
// along with the Ethermint library. If not, see https://github.com/zeta-chain/ethermint/blob/main/LICENSE

package ante

Expand All @@ -24,10 +24,9 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/params"
"github.com/evmos/ethermint/x/evm/statedb"
evmtypes "github.com/evmos/ethermint/x/evm/types"
evm "github.com/evmos/ethermint/x/evm/vm"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
"github.com/zeta-chain/ethermint/x/evm/statedb"
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"
feemarkettypes "github.com/zeta-chain/ethermint/x/feemarket/types"
)

// DynamicFeeEVMKeeper is a subset of EVMKeeper interface that supports dynamic fee checker
Expand All @@ -42,7 +41,7 @@ type EVMKeeper interface {
statedb.Keeper
DynamicFeeEVMKeeper

NewEVM(ctx sdk.Context, msg core.Message, cfg *statedb.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB) evm.EVM
NewEVM(ctx sdk.Context, msg core.Message, cfg *statedb.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB) *vm.EVM
DeductTxCostsFromUserBalance(ctx sdk.Context, fees sdk.Coins, from common.Address) error
GetBalance(ctx sdk.Context, addr common.Address) *big.Int
ResetTransientGasUsed(ctx sdk.Context)
Expand Down
Loading

0 comments on commit d27d32a

Please sign in to comment.