-
Notifications
You must be signed in to change notification settings - Fork 58
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
refactor: clarify data request transaction weight formula #1966
Conversation
data_structures/src/transaction.rs
Outdated
@@ -379,20 +384,18 @@ impl DRTransactionBody { | |||
|
|||
/// Data Request Transaction weight | |||
pub fn weight(&self) -> u32 { | |||
// DR_weight = DR_size*alpha + W*COMMIT + W*REVEAL*beta + TALLY*beta + W*OUTPUT_SIZE | |||
// DR_weight = DR_output_size + W*COMMIT + W*REVEAL*beta + TALLY*beta + (W + M)*OUTPUT_SIZE + N*INPUT_SIZE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// DR_weight = DR_output_size + W*COMMIT + W*REVEAL*beta + TALLY*beta + (W + M)*OUTPUT_SIZE + N*INPUT_SIZE | |
// DR_weight = DR_output_size*alpha + W*COMMIT + W*REVEAL*beta + TALLY*beta + (W + M)*OUTPUT_SIZE + N*INPUT_SIZE |
data_structures/src/transaction.rs
Outdated
|
||
let inputs_len = u32::try_from(self.inputs.len()).unwrap_or(u32::MAX); | ||
let outputs_len = u32::try_from(self.outputs.len()).unwrap_or(u32::MAX); | ||
let dr_weight = self.dr_output.weight().saturating_mul(ALPHA); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let dr_weight = self.dr_output.weight().saturating_mul(ALPHA); | |
let dr_output_size = self.dr_output.weight().saturating_mul(ALPHA); |
data_structures/src/transaction.rs
Outdated
/// Data Request Transaction weight | ||
pub fn weight(&self) -> u32 { | ||
// DR_weight = DR_size*alpha + W*COMMIT + W*REVEAL*beta + TALLY*beta + W*OUTPUT_SIZE | ||
// DR_weight = DR_output_size*alpha + W*COMMIT + W*REVEAL*beta + TALLY*beta + N*INPUT_SIZE + (W + M)*OUTPUT_SIZE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving the formula to the documentation of the function?
No description provided.