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

Quoting upgrade nodeside #2495

Closed
wants to merge 3 commits into from

Conversation

grumbach
Copy link
Member

@grumbach grumbach commented Dec 5, 2024

No description provided.

} else {
calculate_cost_for_records(quoting_metrics.close_records_stored)
};
// NB TODO tell happybeing!

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
autonomi/src/client/quote.rs Dismissed Show dismissed Hide dismissed
autonomi/src/client/quote.rs Dismissed Show dismissed Hide dismissed
autonomi/src/client/quote.rs Dismissed Show dismissed Hide dismissed
autonomi/src/client/registers.rs Fixed Show fixed Hide fixed
autonomi/src/client/utils.rs Fixed Show fixed Hide fixed
autonomi/src/client/utils.rs Fixed Show fixed Hide fixed
autonomi/src/client/vault.rs Fixed Show fixed Hide fixed
verify_data_payment(
self,
tx_hash,
quote_hash,
// quoting_metrics, // NB TODO use them here @Mick

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
reward_addr,
amount,
Default::default(), // NB TODO remove amounts @Mick

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
// takes a long time to run
#[ignore]
#[test]
fn address_distribution_sim() {
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest move the above calculate_cost_for_records function into the test mod, and retain these tests.
This serves as simulating tests of what pricing curve to be.


// vdash metric (if modified please notify at https://github.com/happybeing/vdash/issues):
info!("Total payment of {storecost:?} atto tokens accepted for record {pretty_key}");
info!("Total payment of {reward_amount:?} atto tokens accepted for record {pretty_key}");
Copy link
Member

Choose a reason for hiding this comment

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

this and couple of following logs/prints could be misleading if switched to say pay median or gradual emission scheme.
So, need to make sure the returned reward_amount is really the amount paid to this node directly, or the cost calculated according to the quoting metrics and pricing curve, or something else.

if self.evm_network().verify_data_payment() cann't return with something like (transaction_total_amount, paid_to_node, calculated_from_metrics), then we shall be careful on the wording here.

}
all_costs.push((peer_address, payment_address, PaymentQuote::zero()));
info!("Address {record_address:?} was already paid for according to {peer_address:?}, ending quote request");
return Ok(vec![]);
Copy link
Member

Choose a reason for hiding this comment

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

this actually creates a hole that if any malicious node replies with RecordExists , it will blocks the upload.
I'd suggest leave it and continue with collect of other responses.
Then decided whether to pay or not by: if find majority of RecordExists responses, or verified can fetch from network

@grumbach
Copy link
Member Author

grumbach commented Dec 6, 2024

Continued in #2497

@grumbach grumbach closed this Dec 6, 2024
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