-
Notifications
You must be signed in to change notification settings - Fork 132
feat(x/vm): add OpenTelemetry tracing #871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| // 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R654
| @@ -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)), | ||
| )) |
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...
mainbranch