Skip to content

Commit 16f677c

Browse files
authored
Merge branch 'main' into pd/do-not-return-error-string-on-precompile-error
2 parents 8bf1c7d + cc5bd64 commit 16f677c

File tree

737 files changed

+176076
-4952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

737 files changed

+176076
-4952
lines changed

.github/workflows/go-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
tags: ledger test_ledger_mock
2929
- name: sei-db
3030
path: ./sei-db
31+
- name: sei-ibc-go
32+
path: ./sei-ibc-go
3133
- name: sei-tendermint
3234
path: ./sei-tendermint
3335
- name: sei-wasmd

.github/workflows/integration-test.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
go-version: 1.24
144144

145145
- name: Start 4 node docker cluster
146-
run: make clean && INVARIANT_CHECK_INTERVAL=10 ${{matrix.test.env}} make docker-cluster-start &
146+
run: make clean && DOCKER_DETACH=true INVARIANT_CHECK_INTERVAL=10 ${{matrix.test.env}} make docker-cluster-start
147147

148148
- name: Wait for docker cluster to start
149149
run: |
@@ -170,6 +170,36 @@ jobs:
170170
done
171171
unset IFS # revert the internal field separator back to default
172172
173+
- name: Prepare log artifact name
174+
if: ${{ always() }}
175+
id: log_artifact_meta
176+
run: |
177+
raw="${{ matrix.test.name }}"
178+
safe=$(echo "$raw" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/^-+|-+$//g')
179+
if [ -z "$safe" ]; then
180+
safe="logs"
181+
fi
182+
echo "artifact_name=$safe" >> $GITHUB_OUTPUT
183+
184+
- name: Collect logs directory
185+
if: ${{ always() }}
186+
run: |
187+
LOG_ROOT="artifacts/sei-${{ steps.log_artifact_meta.outputs.artifact_name }}"
188+
mkdir -p "$LOG_ROOT"
189+
if [ -d build/generated/logs ]; then
190+
cp -r build/generated/logs "$LOG_ROOT/"
191+
else
192+
echo "No logs directory found"
193+
fi
194+
195+
- name: Upload logs directory
196+
if: ${{ always() }}
197+
uses: actions/upload-artifact@v4
198+
with:
199+
name: integration-logs-${{ steps.log_artifact_meta.outputs.artifact_name }}
200+
path: artifacts/sei-${{ steps.log_artifact_meta.outputs.artifact_name }}
201+
if-no-files-found: warn
202+
173203
integration-test-check:
174204
name: Integration Test Check
175205
runs-on: ubuntu-latest

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ COPY sei-wasmvm/go.mod sei-wasmvm/go.sum ./sei-wasmvm/
1212
COPY sei-wasmd/go.mod sei-wasmd/go.sum ./sei-wasmd/
1313
COPY sei-cosmos/go.mod sei-cosmos/go.sum ./sei-cosmos/
1414
COPY sei-tendermint/go.mod sei-tendermint/go.sum ./sei-tendermint/
15+
COPY sei-ibc-go/go.mod sei-ibc-go/go.sum ./sei-ibc-go/
1516
COPY sei-db/go.mod sei-db/go.sum ./sei-db/
1617
RUN go mod download
1718

Makefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ ldflags := $(strip $(ldflags))
6767
# BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' -race
6868
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'
6969
BUILD_FLAGS_MOCK_BALANCES := -tags "$(build_tags) mock_balances" -ldflags '$(ldflags)'
70+
BUILD_FLAGS_BENCHMARK := -tags "$(build_tags) benchmark mock_balances" -ldflags '$(ldflags)'
7071

7172
#### Command List ####
7273

@@ -78,6 +79,9 @@ install: go.sum
7879
install-mock-balances: go.sum
7980
go install $(BUILD_FLAGS_MOCK_BALANCES) ./cmd/seid
8081

82+
install-bench: go.sum
83+
go install $(BUILD_FLAGS_BENCHMARK) ./cmd/seid
84+
8185
install-with-race-detector: go.sum
8286
go install -race $(BUILD_FLAGS) ./cmd/seid
8387

@@ -262,14 +266,26 @@ docker-cluster-start: docker-cluster-stop build-docker-node
262266
@rm -rf $(PROJECT_HOME)/build/generated
263267
@mkdir -p $(shell go env GOPATH)/pkg/mod
264268
@mkdir -p $(shell go env GOCACHE)
265-
@cd docker && USERID=$(shell id -u) GROUPID=$(shell id -g) GOCACHE=$(shell go env GOCACHE) NUM_ACCOUNTS=10 INVARIANT_CHECK_INTERVAL=${INVARIANT_CHECK_INTERVAL} UPGRADE_VERSION_LIST=${UPGRADE_VERSION_LIST} MOCK_BALANCES=${MOCK_BALANCES} docker compose up
269+
@cd docker && \
270+
if [ "$${DOCKER_DETACH:-}" = "true" ]; then \
271+
DETACH_FLAG="-d"; \
272+
else \
273+
DETACH_FLAG=""; \
274+
fi; \
275+
USERID=$(shell id -u) GROUPID=$(shell id -g) GOCACHE=$(shell go env GOCACHE) NUM_ACCOUNTS=10 INVARIANT_CHECK_INTERVAL=${INVARIANT_CHECK_INTERVAL} UPGRADE_VERSION_LIST=${UPGRADE_VERSION_LIST} MOCK_BALANCES=${MOCK_BALANCES} docker compose up $$DETACH_FLAG
266276

267277
.PHONY: localnet-start
268278

269279
# Use this to skip the seid build process
270280
docker-cluster-start-skipbuild: docker-cluster-stop build-docker-node
271281
@rm -rf $(PROJECT_HOME)/build/generated
272-
@cd docker && USERID=$(shell id -u) GROUPID=$(shell id -g) GOCACHE=$(shell go env GOCACHE) NUM_ACCOUNTS=10 SKIP_BUILD=true docker compose up
282+
@cd docker && \
283+
if [ "$${DOCKER_DETACH:-}" = "true" ]; then \
284+
DETACH_FLAG="-d"; \
285+
else \
286+
DETACH_FLAG=""; \
287+
fi; \
288+
USERID=$(shell id -u) GROUPID=$(shell id -g) GOCACHE=$(shell go env GOCACHE) NUM_ACCOUNTS=10 SKIP_BUILD=true docker compose up $$DETACH_FLAG
273289
.PHONY: localnet-start
274290

275291
# Stop 4-node docker containers
@@ -308,4 +324,4 @@ test-group-%:split-test-packages
308324
echo "⚡ Not found, running with -parallel=4"; \
309325
PARALLEL="-parallel=4"; \
310326
fi; \
311-
cat $(BUILDDIR)/packages.txt.$* | xargs go test $$PARALLEL -mod=readonly -timeout=10m -race -coverprofile=$*.profile.out -covermode=atomic -coverpkg=./...
327+
cat $(BUILDDIR)/packages.txt.$* | xargs go test $$PARALLEL -mod=readonly -timeout=10m -race -coverprofile=$*.profile.out -covermode=atomic -coverpkg=./...

app/abci.go

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ package app
22

33
import (
44
"context"
5+
"crypto/sha256"
56
"time"
67

78
"github.com/cosmos/cosmos-sdk/telemetry"
89
sdk "github.com/cosmos/cosmos-sdk/types"
10+
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
11+
"github.com/cosmos/cosmos-sdk/types/legacytm"
912
"github.com/sei-protocol/sei-chain/app/legacyabci"
1013
"github.com/sei-protocol/sei-chain/utils/metrics"
1114
abci "github.com/tendermint/tendermint/abci/types"
@@ -50,17 +53,60 @@ func (app *App) MidBlock(ctx sdk.Context, height int64) []abci.Event {
5053
return app.BaseApp.MidBlock(ctx, height)
5154
}
5255

53-
func (app *App) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) (res abci.ResponseEndBlock) {
56+
func (app *App) EndBlock(ctx sdk.Context, height int64, blockGasUsed int64) (res abci.ResponseEndBlock) {
5457
spanCtx, span := app.GetBaseApp().TracingInfo.StartWithContext("EndBlock", ctx.TraceSpanContext())
5558
defer span.End()
5659
ctx = ctx.WithTraceSpanContext(spanCtx)
57-
return app.BaseApp.EndBlock(ctx, req)
60+
defer telemetry.MeasureSince(time.Now(), "abci", "end_block")
61+
ctx = ctx.WithEventManager(sdk.NewEventManager())
62+
defer telemetry.MeasureSince(time.Now(), "module", "total_end_block")
63+
res.ValidatorUpdates = legacyabci.EndBlock(ctx, height, blockGasUsed, app.EndBlockKeepers)
64+
res.Events = sdk.MarkEventsToIndex(ctx.EventManager().ABCIEvents(), app.IndexEvents)
65+
if cp := app.GetConsensusParams(ctx); cp != nil {
66+
res.ConsensusParamUpdates = legacytm.ABCIToLegacyConsensusParams(cp)
67+
}
68+
return res
5869
}
5970

6071
func (app *App) CheckTx(ctx context.Context, req *abci.RequestCheckTxV2) (*abci.ResponseCheckTxV2, error) {
6172
_, span := app.GetBaseApp().TracingInfo.StartWithContext("CheckTx", ctx)
6273
defer span.End()
63-
return app.BaseApp.CheckTx(ctx, req)
74+
defer telemetry.MeasureSince(time.Now(), "abci", "check_tx")
75+
sdkCtx := app.GetCheckTxContext(req.Tx, req.Type == abci.CheckTxTypeV2Recheck)
76+
tx, err := app.txDecoder(req.Tx)
77+
if err != nil {
78+
res := sdkerrors.ResponseCheckTx(err, 0, 0, false)
79+
return &abci.ResponseCheckTxV2{ResponseCheckTx: &res}, err
80+
}
81+
checksum := sha256.Sum256(req.Tx)
82+
gInfo, result, txCtx, err := legacyabci.CheckTx(sdkCtx, tx, app.GetTxConfig(), &app.CheckTxKeepers, checksum, func(ctx sdk.Context) (sdk.Context, sdk.CacheMultiStore) {
83+
return app.CacheTxContext(ctx, checksum)
84+
}, app.GetCheckCtx, app.TracingInfo)
85+
if err != nil {
86+
res := sdkerrors.ResponseCheckTx(err, gInfo.GasWanted, gInfo.GasUsed, false)
87+
return &abci.ResponseCheckTxV2{ResponseCheckTx: &res}, err
88+
}
89+
90+
res := &abci.ResponseCheckTxV2{
91+
ResponseCheckTx: &abci.ResponseCheckTx{
92+
GasWanted: int64(gInfo.GasWanted), //nolint:gosec
93+
Data: result.Data,
94+
Priority: txCtx.Priority(),
95+
GasEstimated: int64(gInfo.GasEstimate), //nolint:gosec
96+
},
97+
ExpireTxHandler: txCtx.ExpireTxHandler(),
98+
CheckTxCallback: txCtx.CheckTxCallback(),
99+
EVMNonce: txCtx.EVMNonce(),
100+
EVMSenderAddress: txCtx.EVMSenderAddress(),
101+
IsEVM: txCtx.IsEVM(),
102+
Priority: txCtx.Priority(),
103+
}
104+
if txCtx.PendingTxChecker() != nil {
105+
res.IsPendingTransaction = true
106+
res.Checker = txCtx.PendingTxChecker()
107+
}
108+
109+
return res, nil
64110
}
65111

66112
func (app *App) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTxV2, tx sdk.Tx, checksum [32]byte) abci.ResponseDeliverTx {

0 commit comments

Comments
 (0)