erigontech / erigontech/erigon

Refator domains API to include a context

Open
#18,097 2 comments 0 reactions 0 assignees View on GitHub
tech debt reduction
Dominant language
Go
Stars
3.6k
Forks
1.5k
Avg merge
1d 16h
Merged PRs (30d)
455

Description

See: https://github.com/erigontech/erigon/pull/17783

I added to allow passing of contextual metering into the aggregator TX:

```go
func (at *AggregatorRoTx) MeteredGetLatest(domain kv.Domain, k []byte, tx kv.Tx, maxStep kv.Step, metrics *changeset.DomainMetrics, start time.Time) (v []byte, step kv.Step, ok bool, err error)
```

This would be more consistent with standard go metering practice if we passed this via a context.Context, but the TX API does not include a context. The above was implemented as tactical fix.

Not also we probably want to add tracing into oTX's for the same reason so we can trace the contribution to high level activities made by these lower level funtions. If we do this we should probably also pass the logger via the context, which is also standard go practice, rather than adding it as a function argument (this thoough is quite a major refactor).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.