Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: progress in quoting land #2498

Conversation

grumbach
Copy link
Member

@grumbach grumbach commented Dec 6, 2024

No description provided.

@grumbach grumbach force-pushed the feat-upgradable-smart-contracts-and-updated-quotation-flow-2 branch from 6afe055 to 37555c9 Compare December 6, 2024 08:16
@@ -406,6 +408,10 @@ impl Network {
.send_and_get_responses(&close_nodes, &request, true)
.await;

// consider data to be already paid for if 1/3 of the close nodes already have it
let mut peer_already_have_it = 0;
let enough_peers_already_have_it = close_nodes.len() / 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid malicious attacke, better at least have 2 holders.
for close_nodes.len() = 5, enough_peers_already_have_it will have a value of 1, which is somehow vulunerable.
maybe make it std::cmp::max(2, close_nodes.len()/3) or close_nodes.len() / 2 instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense let's go with: close_nodes.len() / 2

.duration_since(UNIX_EPOCH)
.map_err(|e| {
Error::InvalidRequest(format!(
"Payment quote timestamp is invalid for record {pretty_key}: {e}"
))
})?
.as_secs();
// NB TODO @mick: can we check if the quote has expired with block time in evmlib? Or should nodes do it manually here? Else keep the block below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the quote was made by the node, not related to the block time, hence have to do it manually ?
unless node using block time on quote, which requires an extra query to the block?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't really couple a transaction to a quote anymore since we no longer use the transaction's event logs to verify payments. So we'd have to do it manually.

@mickvandijke mickvandijke merged commit 37555c9 into maidsafe:feat-upgradable-smart-contracts-and-updated-quotation-flow Dec 9, 2024
7 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants