erigontech / erigontech/erigon
DHII interface evolution
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.5k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 455
Description
> My thoughts (not requrements):
> ```
> domain := tx.Domain(domainName string)
> domain.GetLatest()
> ```
>
> It will:
> - solve problem of `i can't pass type InvertedIndex to func which expecting Domain type`
> - it will allow typed access to domain/ii funcs - and also will group funcs in `kv_interface`
> - it's similar to cursors on table, but idea is from https://github.com/etcd-io/bbolt?tab=readme-ov-file#using-buckets - i removed `Bucket` method long time ago - for performance and for closer match mdbx api. But maybe we can re-visit this decision.
> - it will allow name-checks once (inside `.Domain()`) instead of doing them in every `.GetLatest(domainName, k)` call
> - it will drop on our head interface-conversion (alloc) - but i guess it's solvable (like in `SD` we had field of type `AggTx` and `Tx` - of same object to avoid interface casts amount).
> - Actually! `.Domain(name)` can return non-interface object defined in `kv` package! Because it's just `structure {name string, tx TemporalTx}`. It even can be non-pointer.
>
>
>
_Originally posted by @AskAlexSharov in [#15550](https://github.com/erigontech/erigon/issues/15550#issuecomment-2968765259)_
Contributor guide
Assessment
This issue has not been assessed yet.