[v0.47] [Util] Improve remote debugging tooling#8504
[v0.47] [Util] Improve remote debugging tooling#8504
Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| span := programs.tracer.StartChildSpan(trace.FVMEnvGetOrLoadProgram) | ||
| if span.Tracer != nil { | ||
| span.SetAttributes( | ||
| attribute.String("location", location.ID()), | ||
| ) | ||
| } | ||
| defer span.End() |
There was a problem hiding this comment.
I would prefer to avoid having the if span.Tracer != nil check if possible.
We can add a SetAttributes to tracing.TracerSpan:
func (tracer TracerSpan) SetAttributes(kv ...attribute.KeyValue) {
if tracer.IsTraceable() {
tracer.Span.SetAttributes(kv...)
}
}And I think this instance can even be replaced with:
defer programs.tracer.StartChildSpan(
trace.FVMEnvGetOrLoadProgram,
otel.WithAttributes(attribute.String("location", location.ID())),
).End()|
|
||
| Cmd.Flags().Uint64Var(&flagComputeLimit, "compute-limit", flow.DefaultMaxTransactionGasLimit, "transaction compute limit") | ||
|
|
||
| Cmd.Flags().BoolVar(&flagUseExecutionDataAPI, "use-execution-data-api", true, "use the execution data API (default: true)") |
There was a problem hiding this comment.
| Cmd.Flags().BoolVar(&flagUseExecutionDataAPI, "use-execution-data-api", true, "use the execution data API (default: true)") | |
| Cmd.Flags().BoolVar(&flagUseExecutionDataAPI, "use-execution-data-api", true, "use the execution data API") |
cobra already states the defaults
|
|
||
| // resolveBlockChain fetches count consecutive block IDs starting from startBlockID, | ||
| // following parent IDs, and returns them as hex strings. | ||
| func resolveBlockChain(startBlockID string, count int) []string { |
There was a problem hiding this comment.
I think we are all trying to resolve the blockchain in one way or another...
Maybe a better naming would be getBlocksAfter.
Also, if I'm not mistaken, the method gets blocks before startBlockID, since it goes to the parent. Is that intentional? If it is, it is a bit counterintuitive and should definitely be documented.
Port #8440 to v0.47, so we can compare v0.47 against v0.48