Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e87de92
txn digest
philipsu522 Sep 14, 2022
211b036
bump version
philipsu522 Sep 14, 2022
39d5cae
version bump
philipsu522 Sep 15, 2022
448bce7
bump version
philipsu522 Sep 15, 2022
5f28c8a
mod tidy
philipsu522 Sep 15, 2022
4817f69
tm version bump
philipsu522 Sep 15, 2022
94b2004
tm version bump
philipsu522 Sep 15, 2022
d7fd6a3
tm bump
philipsu522 Sep 15, 2022
d9b4c2f
fixes
philipsu522 Sep 15, 2022
a8cf61d
tm bump
philipsu522 Sep 15, 2022
b3c013e
tm bump
philipsu522 Sep 15, 2022
4d85715
tidy
philipsu522 Sep 15, 2022
1591017
outerloop fix2
philipsu522 Sep 15, 2022
0b8f790
tm bump
philipsu522 Sep 15, 2022
3e7eff6
bump tm
philipsu522 Sep 15, 2022
c21d13c
add evsw for new proposal
philipsu522 Sep 15, 2022
3dad288
fix block hash
philipsu522 Sep 18, 2022
4cf4b5f
tm bump
philipsu522 Sep 19, 2022
25d780f
Add proposal block to prevote
philipsu522 Sep 19, 2022
3cbe35f
trycreateproposal
philipsu522 Sep 19, 2022
beaede2
lower logging, fix tx req
philipsu522 Sep 19, 2022
583c1a8
metrics
philipsu522 Sep 19, 2022
a8a2373
register metrics
philipsu522 Sep 19, 2022
fabe001
fix metric name
philipsu522 Sep 19, 2022
fc270bc
tmbump
philipsu522 Sep 19, 2022
5695c97
continue gossiping blockparts
philipsu522 Sep 19, 2022
c61d444
enable more psulogs
philipsu522 Sep 20, 2022
5fc61d0
tmbump
philipsu522 Sep 20, 2022
081f265
more logs, gossip txn false
philipsu522 Sep 20, 2022
7fc889b
set flag to true
philipsu522 Sep 20, 2022
b09e0cd
fix added logic
philipsu522 Sep 20, 2022
959f13c
reduce logs
philipsu522 Sep 20, 2022
617c17b
less logging
philipsu522 Sep 20, 2022
cfa029f
set gossip-tx-onlyl false
philipsu522 Sep 20, 2022
18002fb
set gossip-tx-only true
philipsu522 Sep 20, 2022
8ffcea3
turn off recheck
philipsu522 Sep 21, 2022
ded3f02
fix config
philipsu522 Sep 21, 2022
0f1ebb3
cleanup
philipsu522 Sep 22, 2022
c40440b
tidy
philipsu522 Sep 22, 2022
d4eb032
Add tracing
philipsu522 Sep 22, 2022
6f9392a
tracing trycreateproposal
philipsu522 Sep 22, 2022
8f14592
trycreateproposal once
philipsu522 Sep 22, 2022
4caa007
fix trycreate cond
philipsu522 Sep 22, 2022
2154b0a
fix metrics
philipsu522 Sep 22, 2022
3e24c84
fixes
philipsu522 Sep 22, 2022
5b2198c
tmbump & spans
philipsu522 Sep 26, 2022
8de273d
rebase'
philipsu522 Sep 26, 2022
90060c3
add lgoging
philipsu522 Sep 26, 2022
f9a8456
multithreading
philipsu522 Sep 29, 2022
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
10 changes: 5 additions & 5 deletions app/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func (app *App) CheckTx(ctx context.Context, req *abci.RequestCheckTx) (*abci.Re
}

func (app *App) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTx) abci.ResponseDeliverTx {
// tracectx, span := (*app.tracingInfo.Tracer).Start(app.tracingInfo.TracerContext, "DeliverTx")
// oldCtx := app.tracingInfo.TracerContext
// app.tracingInfo.TracerContext = tracectx
// defer span.End()
// defer func() { app.tracingInfo.TracerContext = oldCtx }()
tracectx, span := (*app.tracingInfo.Tracer).Start(app.tracingInfo.TracerContext, "DeliverTx")
oldCtx := app.tracingInfo.TracerContext
app.tracingInfo.TracerContext = tracectx
defer span.End()
defer func() { app.tracingInfo.TracerContext = oldCtx }()
return app.BaseApp.DeliverTx(ctx, req)
}

Expand Down
7 changes: 3 additions & 4 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
"github.com/sei-protocol/sei-chain/app/antedecorators"
"github.com/sei-protocol/sei-chain/utils/tracing"
"github.com/sei-protocol/sei-chain/x/dex"
dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper"
Expand Down Expand Up @@ -66,11 +65,9 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
// sigVerifyDecorator = ante.NewBatchSigVerificationDecorator(options.BatchVerifier, sequentialVerifyDecorator)
// }

memPoolDecorator := ante.NewMempoolFeeDecorator()
anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
// TODO: have dex antehandler separate, and then call the individual antehandlers FROM the gasless antehandler decorator wrapper
antedecorators.NewGaslessDecorator([]sdk.AnteDecorator{&memPoolDecorator}, *options.OracleKeeper),
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
ante.NewRejectExtensionOptionsDecorator(),
Expand All @@ -79,7 +76,9 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
// PriorityDecorator must be called after DeductFeeDecorator which sets tx priority based on tx fees
//antedecorators.NewPriorityDecorator(),
// SetPubKeyDecorator must be called before all signature verification decorators
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
Expand Down
27 changes: 18 additions & 9 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"os"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -832,7 +833,7 @@ func (app *App) ProcessProposalHandler(ctx sdk.Context, req *abci.RequestProcess
}
app.optimisticProcessingInfo = optimisticProcessingInfo
go func() {
events, txResults, endBlockResp, _ := app.ProcessBlock(ctx, req.Txs, req, req.ProposedLastCommit)
events, txResults, endBlockResp, _ := app.ProcessBlock(ctx, app.tracingInfo.TracerContext, req.Txs, req, req.ProposedLastCommit)
optimisticProcessingInfo.Events = events
optimisticProcessingInfo.TxRes = txResults
optimisticProcessingInfo.EndBlockResp = endBlockResp
Expand All @@ -847,6 +848,8 @@ func (app *App) ProcessProposalHandler(ctx sdk.Context, req *abci.RequestProcess
}

func (app *App) FinalizeBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) {
spanCtx, span := (*app.tracingInfo.Tracer).Start(app.tracingInfo.TracerContext, "FinalizeBlocker")
defer span.End()
startTime := time.Now()
defer func() {
app.optimisticProcessingInfo = nil
Expand All @@ -867,17 +870,23 @@ func (app *App) FinalizeBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock)
}
}
ctx.Logger().Info("optimistic processing ineligible")
events, txResults, endBlockResp, _ := app.ProcessBlock(ctx, req.Txs, req, req.DecidedLastCommit)
events, txResults, endBlockResp, _ := app.ProcessBlock(ctx, spanCtx, req.Txs, req, req.DecidedLastCommit)

app.SetDeliverStateToCommit()
_, writeStateSpan := (*app.tracingInfo.Tracer).Start(spanCtx, "WriteStateToCommitAndGetWorkignHash")
ctx.Logger().Info("starting write state to commit:" + strconv.FormatInt(time.Now().UnixMilli(), 10))
appHash := app.WriteStateToCommitAndGetWorkingHash()
ctx.Logger().Info("finishing write state to commit:" + strconv.FormatInt(time.Now().UnixMilli(), 10))
writeStateSpan.End()
resp := app.getFinalizeBlockResponse(appHash, events, txResults, endBlockResp)
return &resp, nil
}

func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequest, lastCommit abci.CommitInfo) ([]abci.Event, []*abci.ExecTxResult, abci.ResponseEndBlock, error) {
goCtx := app.decorateContextWithDexMemState(ctx.Context())
ctx = ctx.WithContext(goCtx)
func (app *App) ProcessBlock(sdkCtx sdk.Context, ctx context.Context, txs [][]byte, req BlockProcessRequest, lastCommit abci.CommitInfo) ([]abci.Event, []*abci.ExecTxResult, abci.ResponseEndBlock, error) {
_, span := (*app.tracingInfo.Tracer).Start(ctx, "ProcessBlock")
defer span.End()
goCtx := app.decorateContextWithDexMemState(sdkCtx.Context())
sdkCtx = sdkCtx.WithContext(goCtx)

events := []abci.Event{}
beginBlockReq := abci.RequestBeginBlock{
Expand All @@ -898,11 +907,11 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ
ChainID: app.ChainID,
Height: req.GetHeight(),
Time: req.GetTime(),
ProposerAddress: ctx.BlockHeader().ProposerAddress,
ProposerAddress: sdkCtx.BlockHeader().ProposerAddress,
},
}

beginBlockResp := app.BeginBlock(ctx, beginBlockReq)
beginBlockResp := app.BeginBlock(sdkCtx, beginBlockReq)
events = append(events, beginBlockResp.Events...)

// typedTxs := []sdk.Tx{}
Expand All @@ -919,7 +928,7 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ
txResults := []*abci.ExecTxResult{}
for _, tx := range txs {
// ctx = ctx.WithContext(context.WithValue(ctx.Context(), ante.ContextKeyTxIndexKey, i))
deliverTxResp := app.DeliverTx(ctx, abci.RequestDeliverTx{
deliverTxResp := app.DeliverTx(sdkCtx, abci.RequestDeliverTx{
Tx: tx,
})
txResults = append(txResults, &abci.ExecTxResult{
Expand All @@ -933,7 +942,7 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ
Codespace: deliverTxResp.Codespace,
})
}
endBlockResp := app.EndBlock(ctx, abci.RequestEndBlock{
endBlockResp := app.EndBlock(sdkCtx, abci.RequestEndBlock{
Height: req.GetHeight(),
})
events = append(events, endBlockResp.Events...)
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ require (
github.com/regen-network/cosmos-proto v0.3.1
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.7.2
github.com/stretchr/testify v1.8.0
github.com/tendermint/tendermint v0.37.0-dev
github.com/tendermint/tm-db v0.6.8-0.20220519162814-e24b96538a12
go.opentelemetry.io/otel v1.9.0
go.opentelemetry.io/otel/exporters/jaeger v1.9.0
go.opentelemetry.io/otel/sdk v1.9.0
go.opentelemetry.io/otel/trace v1.9.0
google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.1
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -129,9 +129,9 @@ require (
)

replace (
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.20
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.66
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4
github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.13
github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.55
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1095,10 +1095,10 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo=
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/sei-protocol/sei-cosmos v0.1.20 h1:QqYntfddnFBRLGCOVdIlwDg5Xa3TlfmhSEcg9ehx1Ys=
github.com/sei-protocol/sei-cosmos v0.1.20/go.mod h1:9JV9q6Ds2FpU409zu8sw8feCaOiGZApUMjaHvXQOmc8=
github.com/sei-protocol/sei-tendermint v0.1.13 h1:uaMXhi+zpaqcUDlshxjqmPmUI/zSZla2a2ZmOtDK5RM=
github.com/sei-protocol/sei-tendermint v0.1.13/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8=
github.com/sei-protocol/sei-cosmos v0.1.66 h1:ow4z4wKm1iN1GoZAaz+kCB6nv+BKSLnhpFvyale785M=
github.com/sei-protocol/sei-cosmos v0.1.66/go.mod h1:3uCdb2FCio9uVQRPdZxZ1GqHqyb1moYH93xtTMa7DL8=
github.com/sei-protocol/sei-tendermint v0.1.55 h1:8sMusnZ8GxC8h0eblmDTLe7YW9DcUNc1YSdrH3RhsGo=
github.com/sei-protocol/sei-tendermint v0.1.55/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs=
github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
Expand Down Expand Up @@ -1166,8 +1166,9 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J
github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
Expand All @@ -1177,8 +1178,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI=
github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs=
Expand Down Expand Up @@ -1901,8 +1903,8 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 h1:sRT5xdTkj1Kbk30qbYC7VyMj73N5pZYsw6v+Nrzdhno=
google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc=
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc h1:Nf+EdcTLHR8qDNN/KfkQL0u0ssxt9OhbaWCl5C0ucEI=
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
Expand Down
Loading