Skip to content

Make PeerId <-> Address resolution use a cache #6045

@NumberFour8

Description

@NumberFour8

Is your feature related to a problem?

When path is being constructed for the packet, translation is required from PeerId to on-chain Address type.
On several different places also the inverse is needed.

This is currently performed by an implementation of PeerAddressResolver asynchronous trait (see

pub struct DbPeerAddressResolver(pub Arc<RwLock<CoreEthereumDb<CurrentDbShim>>>);
) which hits the DB per each packet.

Describe the feature you'd like

Ideally, this managed via a translation table in memory so the DB does not need to be queried, thus making outgoing and forwarded packet processing significantly faster.

The table should work as LRU cache, causing it to hit the DB backend only once an entry expires.

Refs #5891

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions