Skip to content

Conversation

@aaronc
Copy link
Member

@aaronc aaronc commented Oct 29, 2025

Description

Closes: #XXXX

@github-actions github-actions bot removed the C:log label Oct 31, 2025
// implements Queryable.
func (app *BaseApp) Query(_ context.Context, req *abci.RequestQuery) (resp *abci.ResponseQuery, err error) {
func (app *BaseApp) Query(ctx context.Context, req *abci.RequestQuery) (resp *abci.ResponseQuery, err error) {
ctx, span := tracer.Start(ctx, "Query")

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This definition of ctx is never used.

Copilot Autofix

AI 3 days ago

To fix the problem, the assignment to ctx in ctx, span := tracer.Start(ctx, "Query") should be replaced with the blank identifier _, since the new value is not used afterward. Thus, the line should be updated to _ , span := tracer.Start(ctx, "Query"). This keeps the logic correct and makes clear that the new context is irrelevant, and only span is wanted. No additional imports, method, or definition changes are necessary. Only a single line in baseapp/abci.go needs updating.

Suggested changeset 1
baseapp/abci.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/baseapp/abci.go b/baseapp/abci.go
--- a/baseapp/abci.go
+++ b/baseapp/abci.go
@@ -156,7 +156,7 @@
 // Query implements the ABCI interface. It delegates to CommitMultiStore if it
 // implements Queryable.
 func (app *BaseApp) Query(ctx context.Context, req *abci.RequestQuery) (resp *abci.ResponseQuery, err error) {
-	ctx, span := tracer.Start(ctx, "Query")
+	_, span := tracer.Start(ctx, "Query")
 	defer span.End()
 
 	// add panic recovery for all queries
EOF
@@ -156,7 +156,7 @@
// Query implements the ABCI interface. It delegates to CommitMultiStore if it
// implements Queryable.
func (app *BaseApp) Query(ctx context.Context, req *abci.RequestQuery) (resp *abci.ResponseQuery, err error) {
ctx, span := tracer.Start(ctx, "Query")
_, span := tracer.Start(ctx, "Query")
defer span.End()

// add panic recovery for all queries
Copilot is powered by AI and may make mistakes. Always verify output.

blockCnt.Add(ctx, 1)
blockTime.Record(ctx, time.Since(app.blockStartTime).Seconds())
app.blockStartTime = time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
fauxMerkleMode: false,
sigverifyTx: true,
gasConfig: config.GasConfig{QueryGasLimit: math.MaxUint64},
blockStartTime: time.Now(),

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
// both txbytes and the decoded tx are passed to runTx to avoid the state machine encoding the tx and decoding the transaction twice
// passing the decoded tx to runTX is optional, it will be decoded if the tx is nil
func (app *BaseApp) RunTx(mode sdk.ExecMode, txBytes []byte, tx sdk.Tx, txIndex int, txMultiStore storetypes.MultiStore, incarnationCache map[string]any) (gInfo sdk.GasInfo, result *sdk.Result, anteEvents []abci.Event, err error) {
startTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants