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

feat(consensus)!: add tari script byte size limit check to validation #3640

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Dec 6, 2021

Description

  • Adds consensus rules for maximum script byte size

Breaking changes:
If an existing script is larger than 2048, that block/output will fail to validate on upgraded nodes. I have not explicitly checked this but the largest scripts used currently on testnet are one-sided payments and they are well within the limit.

Motivation and Context

See @CjS77 comment

TODO: Ideally, in order to not negatively impact validation performance, we should not have to serialise the script again to gain its byte size.

How Has This Been Tested?

New unit test, basic manual test

@sdbondi sdbondi force-pushed the core-consensus-script-byte-size branch from a074dd4 to 4daf021 Compare December 6, 2021 05:56
* development:
  feat: bad block list for invalid blocks after sync (tari-project#3637)
Copy link
Contributor

@delta1 delta1 left a comment

Choose a reason for hiding this comment

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

LGTM - agreed no current scripts in the chain should be anywhere near this size

@aviator-app aviator-app bot merged commit 53a5174 into tari-project:development Dec 6, 2021
@sdbondi sdbondi deleted the core-consensus-script-byte-size branch December 7, 2021 03:05
sdbondi added a commit to sdbondi/tari that referenced this pull request Dec 7, 2021
* development:
  feat(consensus)!: add tari script byte size limit check to validation (tari-project#3640)
  fix: minor improvements to available neighbouring peer search (tari-project#3598)
  feat: bad block list for invalid blocks after sync (tari-project#3637)
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.

None yet

2 participants