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

Feat upgradable smart contracts and updated quotation flow #2511

Conversation

mickvandijke
Copy link
Contributor

autonomi compiles!

Still some tests to fix most likely though and need to have the final smart contract implementation to fix local deployment on Anvil.

Look for @anselme and // CODE REVIEW for parts where I was a bit unsure!

@@ -77,6 +77,21 @@ impl ProofOfPayment {
.any(|(_, quote)| quote.has_expired())
}

/// Returns all quotes by given peer id
pub fn quotes_by_peer(&self, peer_id: &PeerId) -> Vec<&PaymentQuote> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this also check that the quote is valid for the same peer id?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is caller responsibility? The name doesn't suggest a check is there

let put_cfg = PutRecordCfg {
put_quorum: Quorum::All,
retry_strategy: None,
use_put_record_to: Some(vec![payee]),
use_put_record_to: Some(payees), // CODE REVIEW: should we put to all or just one here?
Copy link
Member

Choose a reason for hiding this comment

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

All sounds good. Maybe in the future, to strain the network less we could put to 1 by 1 until the data is stored

Copy link
Member

Choose a reason for hiding this comment

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

This can come as an optimization

@@ -146,19 +150,21 @@ impl Client {
let put_cfg = PutRecordCfg {
put_quorum: Quorum::One,
retry_strategy: Some(RetryStrategy::Balanced),
use_put_record_to: Some(vec![storing_node]),
use_put_record_to: Some(storing_nodes), // CODE REVIEW: do we put to all payees or just one?
Copy link
Member

Choose a reason for hiding this comment

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

Same here, this would be a good optimization down the line but maybe in the put_record code layer?

Comment on lines +47 to +50
// CODE REVIEW: should we fail on a single invalid payment?
if !payment_verification.is_valid {
return Err(error::Error::PaymentInvalid);
}
Copy link
Member

Choose a reason for hiding this comment

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

For now yeah, I guess this will be a question again when we batch this

@grumbach grumbach merged commit 0279010 into maidsafe:feat-upgradable-smart-contracts-and-updated-quotation-flow Dec 10, 2024
11 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.

2 participants