Skip to content

Commit

Permalink
Merge pull request maidsafe#2358 from grumbach/crdt_record_put_verifi…
Browse files Browse the repository at this point in the history
…cation

fix: allow split records during crdt record puts verifications
  • Loading branch information
grumbach authored Oct 31, 2024
2 parents 374e84b + 737a914 commit 1352fcb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autonomi/src/client/registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl Client {
put_quorum: Quorum::All,
retry_strategy: None,
use_put_record_to: None,
verification: Some((VerificationKind::Network, get_cfg)),
verification: Some((VerificationKind::Crdt, get_cfg)),
};

// Store the updated register on the network
Expand Down
2 changes: 1 addition & 1 deletion autonomi/src/client/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl Client {
retry_strategy: Some(RetryStrategy::Balanced),
use_put_record_to: None,
verification: Some((
VerificationKind::Network,
VerificationKind::Crdt,
GetRecordCfg {
get_quorum: Quorum::Majority,
retry_strategy: None,
Expand Down
2 changes: 2 additions & 0 deletions sn_networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ pub struct PutRecordCfg {
pub enum VerificationKind {
/// Uses the default KAD GET to perform verification.
Network,
/// Uses the default KAD GET to perform verification, but don't error out on split records
Crdt,
/// Uses the hash based verification for chunks.
ChunkProof {
expected_proof: ChunkProof,
Expand Down
5 changes: 5 additions & 0 deletions sn_networking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,11 @@ impl Network {
NetworkAddress::from_record_key(&record_key),
));
}
Err(NetworkError::GetRecordError(GetRecordError::SplitRecord { .. }))
if matches!(verification_kind, VerificationKind::Crdt) =>
{
warn!("Record {pretty_key:?} is split, which is okay since we're dealing with CRDTs");
}
Err(e) => {
debug!(
"Failed to verify record {pretty_key:?} to be stored with error: {e:?}"
Expand Down

0 comments on commit 1352fcb

Please sign in to comment.