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
Paying to each holder in each group #649
Conversation
@@ -776,6 +781,8 @@ | |||
/// Retry up to `PUT_RECORD_RETRIES` times if we can't verify the record is stored | |||
async fn put_record_with_retries(&self, record: Record) -> Result<()> { | |||
let mut retries = 0; | |||
|
|||
// TODO: Move this put retry loop up above store cost checks so we can re-put if storecost failed. |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
e8bc53c
to
ab1b712
Compare
c786fbd
to
c2eb1f3
Compare
c2eb1f3
to
c4c74ea
Compare
@@ -76,5 +83,6 @@ | |||
#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)] | |||
pub struct ChunkWithPayment { | |||
pub chunk: Chunk, | |||
pub payment: PaymentProof, | |||
/// TODO: encrypt this or supply only encrypted derivation index |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
addr_name, | ||
reason: err.to_string(), | ||
})?; | ||
// TODO: properly verify which one of these was for this node, and check _that_ |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
c4c74ea
to
ddc4a5b
Compare
ddc4a5b
to
3f61be5
Compare
assert!(matches!( | ||
verify_fee_output_and_proof(name, network_store_cost, &tx, audit_trail, &[]), | ||
Err(err) if err == ProtocolError::PaymentProofInvalidFeeOutput(invalid_fee_id))); | ||
// TODO: sort out what is acceptable based on the network store cost |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
3f61be5
to
e8ff64d
Compare
e8ff64d
to
8a7eb19
Compare
8a7eb19
to
ab8eab2
Compare
Reviewpad Report
starting to simplify payments to a per chunk basis A first step in #638' (a0b000c)
|
6e3a661
to
30374eb
Compare
30374eb
to
d6fd46f
Compare
Sets us up to pay every node that will be storing the data. We GetStoreCost and pay to their key, and put the chunk with the DBCs This is not yet validated at the node side
This gives maximal resilience as a place to start. (This is required for data location verification tests eg)
019ff3f
to
1b32744
Compare
9f71867
to
8eab1f5
Compare
Holding DBCs causes large mem spikes. For now we allow for this on CI/ We'll refactor this away down the line
cf96ec8
to
4ccdac2
Compare
starting to simplify payments to a per chunk basis
A first step in #638## Description
Summary generated by Reviewpad on 16 Aug 23 14:29 UTC
This pull request includes the following changes:
lib.rs
file:PublicKey
fromlibp2p::identity
and use it in addition toMultiaddr
fromlibp2p
.reward_main_key
of typePublicKey
to the structNode
.file_apis.rs
file:use crate::NetworkAddress
.use crate::messages::PaymentProof
.use sn_dbc::DbcId
.network_address()
, returns theNetworkAddress
associated with the chunk.payment
changed fromPaymentProof
toVec<DbcId>
.api.rs
file:PublicKey
import fromidentity
module.get_store_cost_from_network
toget_store_costs_from_network
and changed its return type toResult<Vec<(PublicKey, Token)>>
.PublicKey
inget_store_costs_from_network
method.put_record_with_retries
method.get_closest_peers
method public.storage_payments.rs
file:sn_dbc::{Hash, Token}
has been removed.random_content_addrs
has been changed fromXorName
tosn_protocol::NetworkAddress::ChunkAddress
.eyre::Result
import has been simplified.invalid_proofs
have been made in the functionstorage_payment_chunk_upload_fails
.mod.rs
file in thesn_protocol/src/messages
directory:use
statement,PaymentProof
has been replaced withPaymentTransactions
.data_with_churn.rs
file:pay_for_storage
is modified to use thenetwork_address()
method instead of thename()
method on each element of thechunks
iterator.verify_data_location.rs
file:store_chunk
function where thepay_for_storage
method is called with thenetwork_address()
method instead of thename()
method on each element of thechunks
iterator.sn_cli/src/subcommands/files.rs
file:sn_transfers::wallet::PaymentProofsMap
has been replaced withsn_transfers::wallet::PaymentTransactionsMap
.payment_proofs
in the functionupload_chunks
has been changed from&PaymentProofsMap
to&PaymentTransactionsMap
.wallet.rs
file:PaymentProofsMap
has been renamed toPaymentTransactionsMap
.get_payment_proof
method now accepts aNetworkAddress
parameter instead ofXorName
, and returns anOption<&Vec<DbcId>>
instead ofOption<&PaymentProof>
.add_payment_proofs
method now accepts aPaymentTransactionsMap
parameter instead ofPaymentProofsMap
.local_send_storage_payment
method now accepts astorage_cost_for_addr
parameter of typeToken
instead ofstorage_payment
androot_hash
.wallet.paymet_proofs
field has been renamed towallet.payment_transactions
..github/workflows/memcheck.yml
file:timeout-minutes
value has been updated from 25 to 40.sn_networking/src/error.rs
file:use libp2p::identity::DecodingError;
.Libp2pDecode
to theError
enum with aDecodingError
parameter.sn_protocol/src/messages/cmd.rs
file:PaymentProof
has been renamed toPaymentTransactions
.audit_trail
andpath
of thePaymentTransactions
struct have been removed.sn_client
module:network_store_cost
field has been removed from theClient
struct.transfer.rs
file:root_hash
variable is no longer passed as a parameter to the functioncreate_storage_payment_transfer()
.root_hash
variable is now created using thesn_dbc::Hash::hash()
function and the value "nonsense" as input.sn_protocol/src/messages/mod.rs
file:sn_protocol::storage::ChunkAddress
has been removed.Please review these changes and let me know if you have any questions or need further assistance.