-
Notifications
You must be signed in to change notification settings - Fork 12
Fix & clarify all uses of "rawSize" #223
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
base: main
Are you sure you want to change the base?
Conversation
Also fixes #221 |
Hey @DarkLord017! Seems like there is a lint-check error that needs to be resolved here |
src/PDPVerifier.sol
Outdated
(uint256 padding, uint8 height,) = Cids.validateCommPv2(tempPieces[resultIndex]); | ||
tempRawSizes[resultIndex] = Cids.pieceSize(padding, height); |
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.
@DarkLord017 let's just break this API, I don't see any current obvious users of this function so I don't there's a huge risk here. Remove uint256[] memory rawSizes
from the return values. It's redundant, since as you're seeing, it's in the CID which we return.
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.
It seems that I added this in the first place, #177, so I'm to blame for the naming here. I take responsibility, but also give permission to break this! It never got consumed by the SDK which was the original intention, but with this fix we can start consuming it.
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.
okay
This pull request updates how raw piece sizes are calculated and improves clarity in proof fee calculations in the
PDPVerifier
contract. The main changes involve switching to a more accurate method for determining piece sizes and renaming variables for better readability.FIxes #217
Piece size calculation improvements:
tempRawSizes
to useCids.pieceSize(padding, height)
instead of multiplying leaf counts by 32, resulting in more accurate piece size determination.Proof fee calculation clarity:
rawSize
toproofSize
incalculateProofFee
,calculateProofFeeForSize
, andcalculateAndBurnProofFee
functions to clarify that the fee is based on the proof size in bytes, not the raw size.challengeRange
represents a leaf count and is converted to bytes by multiplying by 32.