You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently eviction is implemented in terms of the timestamp of the packet, in #2997
The timestamp is the wallclock time when the packet is signed.
This works fine for us since we create new packets every time we publish discovery information. But for pkarr in general, it is perfectly valid to have a packet that was signed some time ago and republish it - that way the publisher does not need the private key. We should change the iroh-dns-server eviction to use the receive time instead of the timestamp.
The downside of this is that somebody, anybody, could prevent a packet from being evicted by just republishing it. However, they can not prevent the packet from being replaced by a newer one. So really nothing to worry about I think.
Doing eviction based on recv time would require storing the recv time separately, so it would be a schema change. There are some things coming in pkarr v3 that would make this easier, so maybe we wait until then...
let keypair = Keypair::random();let signed_packet = SignedPacket::builder().sign(&keypair).unwrap();// Serializing/deserializing `<last_seen u64 big endian><singed_packet>`let signed_packet = SignedPacket::deserialize(&signed_packet.serialize()).unwrap();// And you can get the `last_seen` and it itself is serializable as a u64 big endian too.
signed_packet.last_seen().to_bytes();
Edit: renamed V3 to v3-snapshot since I don't think anyone needs this published any time soon, so no need for v3 and v4.
Currently eviction is implemented in terms of the timestamp of the packet, in #2997
The timestamp is the wallclock time when the packet is signed.
This works fine for us since we create new packets every time we publish discovery information. But for pkarr in general, it is perfectly valid to have a packet that was signed some time ago and republish it - that way the publisher does not need the private key. We should change the iroh-dns-server eviction to use the receive time instead of the timestamp.
The downside of this is that somebody, anybody, could prevent a packet from being evicted by just republishing it. However, they can not prevent the packet from being replaced by a newer one. So really nothing to worry about I think.
Doing eviction based on recv time would require storing the recv time separately, so it would be a schema change. There are some things coming in pkarr v3 that would make this easier, so maybe we wait until then...
Cc @Nuhvi
The text was updated successfully, but these errors were encountered: