Skip to content

Refator domains API to include a context #18097

@mh0lt

Description

@mh0lt

See: #17783

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

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions