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

Add calculation of exact encoded transaction as a function in Transaction trait #2222

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

dailinsubjam
Copy link
Contributor

Closes EspressoSystems/marketplace-builder-core#169

This PR:

This PR does not:

Key places to review:

@@ -60,6 +62,15 @@ impl Transaction {
self.payload
}

pub fn size_in_block(&self, new_ns: bool) -> u64 {
if new_ns {
// each new namespace adds overhead, therefore it includes `NsTableBuilder::entry_byte_len() + NsPayloadBuilder::tx_table_header_byte_len()`
Copy link
Member

@shenkeyao shenkeyao Oct 28, 2024

Choose a reason for hiding this comment

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

This comment makes it sound like we will add an overhead for new namespaces. Can we reword it to something like:

> Each new namespace already includes the overhead, so we don't add it again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's true that we will add an overhead NsTableBuilder::entry_byte_len() + NsPayloadBuilder::tx_table_header_byte_len() for new namespaces. let me add more comments.

@dailinsubjam dailinsubjam changed the base branch from main to hotshot/rc-0.5.79 October 29, 2024 00:44
@dailinsubjam dailinsubjam merged commit 0801a2d into hotshot/rc-0.5.79 Oct 29, 2024
1 check passed
@dailinsubjam dailinsubjam deleted the sishan/trait_builder_transaction branch October 29, 2024 00:51
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.

[Cartesi Issues] - Exact calculation of encoded transaction size
3 participants