Skip to content

Conversation

@technicallyty
Copy link
Contributor

Description

adds tracing to x/vm


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

@technicallyty technicallyty changed the title feat(x/vm): add opentelemetry tracing feat(x/vm): add OpenTelemetry tracing Dec 3, 2025
// validateAuthorization validates an EIP-7702 authorization against the state.
func (k *Keeper) validateAuthorization(auth *ethtypes.SetCodeAuthorization, state vm.StateDB, chainID *big.Int) (authority common.Address, err error) {
func (k *Keeper) validateAuthorization(ctx sdk.Context, auth *ethtypes.SetCodeAuthorization, state vm.StateDB, chainID *big.Int) (authority common.Address, err error) {
ctx, span := ctx.StartSpan(tracer, "validateAuthorization", trace.WithAttributes(

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This definition of ctx is never used.

Copilot Autofix

AI 4 days ago

To fix the issue, simply do not assign the return value for ctx from the StartSpan call since the updated context is not used. This is done by replacing ctx, span := ctx.StartSpan(...) with _ , span := ctx.StartSpan(...), indicating that the updated context is intentionally ignored. This change should be made on line 654 of x/vm/keeper/state_transition.go. No additional imports or definitions are required. Functionality is preserved, while the code becomes clearer and static analysis warnings are resolved.

Suggested changeset 1
x/vm/keeper/state_transition.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/x/vm/keeper/state_transition.go b/x/vm/keeper/state_transition.go
--- a/x/vm/keeper/state_transition.go
+++ b/x/vm/keeper/state_transition.go
@@ -651,7 +651,7 @@
 
 // validateAuthorization validates an EIP-7702 authorization against the state.
 func (k *Keeper) validateAuthorization(ctx sdk.Context, auth *ethtypes.SetCodeAuthorization, state vm.StateDB, chainID *big.Int) (authority common.Address, err error) {
-	ctx, span := ctx.StartSpan(tracer, "validateAuthorization", trace.WithAttributes(
+	_, span := ctx.StartSpan(tracer, "validateAuthorization", trace.WithAttributes(
 		attribute.String("delegate_address", auth.Address.Hex()),
 		attribute.Int64("nonce", int64(auth.Nonce)),
 	))
EOF
@@ -651,7 +651,7 @@

// validateAuthorization validates an EIP-7702 authorization against the state.
func (k *Keeper) validateAuthorization(ctx sdk.Context, auth *ethtypes.SetCodeAuthorization, state vm.StateDB, chainID *big.Int) (authority common.Address, err error) {
ctx, span := ctx.StartSpan(tracer, "validateAuthorization", trace.WithAttributes(
_, span := ctx.StartSpan(tracer, "validateAuthorization", trace.WithAttributes(
attribute.String("delegate_address", auth.Address.Hex()),
attribute.Int64("nonce", int64(auth.Nonce)),
))
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants