maidsafe / safe_network

Autonomi combines the spare capacity of everyday devices to form a new, autonomous, data and communications layer of the Internet
http://autonomi.com
76 stars 48 forks source link

chore: records #1902

Closed joshuef closed 3 months ago

joshuef commented 3 months ago

This pull request primarily modifies the sn_client/src/api.rs, sn_networking/src/driver.rs, sn_networking/src/event/kad.rs, sn_networking/src/lib.rs, sn_networking/src/spends.rs, sn_networking/src/transfers.rs, sn_node/src/put_validation.rs, and sn_node/src/replication.rs files, focusing on improving the handling of spend records and double spend attempts in the network. The changes include renaming methods and adding a new configuration option to accumulate spend attempts, which can help the client decide whether to retry an operation.

Method Renaming:

New Configuration Option:

Handling of Spend Records:

Other Changes:

RolandSherwin commented 3 months ago

EDIT: We already perform this

Also, earlier, when a node sees a double spend during validation, it'd take Vec<SignedSpends>.sort().take(2) and would store that + propagate that to other peers, but currently it is removed from the code. Would that help here? I feel like currently, in case of a double spend, the state for each node is different, but if we sort,accumulate them, we'd get a consistent state among nodes and seeing if a spend is a double spend is relatively easy?

joshuef commented 3 months ago

Closing in favour of 1904