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

Update accounting logic for total encoded blob size #421

Merged

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented Mar 30, 2024

Why are these changes needed?

  • use existing Bundle.Size() method to keep track of the total size of encoded blobs
  • update the bundle size to be in uint64 instead of int64
  • added proof size in Frame.Size()

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim changed the title update encoded blob size accounting Update accounting logic for total encoded blob size Mar 30, 2024
@ian-shim ian-shim marked this pull request as ready for review March 30, 2024 21:46
@ian-shim ian-shim force-pushed the update-encoded-blob-size-accounting branch from b243a84 to 9dcc124 Compare March 30, 2024 21:55
@ian-shim ian-shim force-pushed the update-encoded-blob-size-accounting branch from 9dcc124 to 8dfc912 Compare March 30, 2024 22:07
encoding/data.go Outdated Show resolved Hide resolved
@ian-shim ian-shim force-pushed the update-encoded-blob-size-accounting branch from 75d3770 to 95a5644 Compare April 1, 2024 05:54
Copy link
Contributor

@bxue-l2 bxue-l2 left a comment

Choose a reason for hiding this comment

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

Bundles is the part that concerns me, as long as that is addressed, I am good

disperser/batcher/encoded_blob_store.go Outdated Show resolved Hide resolved
for _, chunk := range b {
size += int64(chunk.Size())
size += chunk.Size()
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for your information, referring to yesterdays discussion, all chunk will now contains 32bytes. Nothing wrong here

size += uint64(len(chunk.Coeffs) * 256) // 256 bytes per symbol
}
return size + 256*2 // + 256 * 2 bytes for proof
return result.Chunks.Size()
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch, 256 byte is 8 times over

@ian-shim ian-shim merged commit 09d3031 into Layr-Labs:master Apr 1, 2024
5 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.

3 participants