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

Limit generated block and transaction size #483

Closed
teor2345 opened this issue Jun 15, 2020 · 1 comment
Closed

Limit generated block and transaction size #483

teor2345 opened this issue Jun 15, 2020 · 1 comment
Labels
A-consensus Area: Consensus rule updates A-rpc Area: Remote Procedure Call interfaces A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement

Comments

@teor2345
Copy link
Contributor

teor2345 commented Jun 15, 2020

When Zebra starts generating its own blocks and transactions, we should limit them to the maximum consensus block size (2,000,000 bytes).

These limits should be checked in the functions that generate blocks and transactions.

In practice, the maximum size of a transaction is around 1.5kB smaller than the maximum block size, because blocks also contain a block header and a transaction count. Zebra might want to use this smaller limit for transactions.

Whatever we decide, it should be consistent with the mempool in #484.

However, zcashd has the larger 2,000,000 byte transaction limit in its consensus rules:
https://github.com/zcash/zcash/blob/63c3d1ec9435b445a883028b9111595ffa9292d4/src/consensus/consensus.h#L29

See #482 for test cases for this code.

@teor2345 teor2345 added Poll::Pending A-consensus Area: Consensus rule updates labels Jun 15, 2020
@teor2345 teor2345 added this to the Wallet Support 💰 milestone Jun 15, 2020
teor2345 added a commit to teor2345/zebra that referenced this issue Jun 16, 2020
We don't need to check transaction sizes yet, because we aren't
parsing or generating transactions outside of blocks.

Part of ZcashFoundation#483.
@teor2345 teor2345 added E-help-wanted Call for participation: Help is requested to fix this issue. good first issue labels Jun 17, 2020
teor2345 added a commit to teor2345/zebra that referenced this issue Jun 24, 2020
We don't need to check transaction sizes yet, because we aren't
parsing or generating transactions outside of blocks.

Part of ZcashFoundation#483.
teor2345 added a commit that referenced this issue Jun 24, 2020
We don't need to check transaction sizes yet, because we aren't
parsing or generating transactions outside of blocks.

Part of #483.
teor2345 added a commit to teor2345/zebra that referenced this issue Jun 24, 2020
We don't need to check transaction sizes yet, because we aren't
parsing or generating transactions outside of blocks.

Part of ZcashFoundation#483.
@teor2345 teor2345 removed good first issue E-help-wanted Call for participation: Help is requested to fix this issue. labels Jun 30, 2020
@hdevalence hdevalence added S-blocked Status: Blocked on other tasks and removed Poll::Pending labels Aug 17, 2020
@mpguerra mpguerra removed this from the Wallet Support 💰 milestone Jan 5, 2021
@teor2345 teor2345 removed the S-blocked Status: Blocked on other tasks label Jan 5, 2021
@mpguerra mpguerra added E-help-wanted Call for participation: Help is requested to fix this issue. and removed E-easy labels Mar 16, 2021
@mpguerra mpguerra moved this to 🆕 New in Zebra Sep 22, 2022
@mpguerra mpguerra added this to Zebra Sep 22, 2022
@teor2345 teor2345 added A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage P-Medium ⚡ A-rpc Area: Remote Procedure Call interfaces and removed E-help-wanted Call for participation: Help is requested to fix this issue. labels Sep 29, 2022
@teor2345
Copy link
Contributor Author

The sendrawtransaction and submitblock RPCs parse transactions and blocks from raw bytes, so they apply the same size limits as zebra-network.

We don't need to do any extra work here.

Repository owner moved this from 🆕 New to ✅ Done in Zebra Sep 29, 2022
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-rpc Area: Remote Procedure Call interfaces A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement
Projects
Archived in project
Development

No branches or pull requests

3 participants