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

Cherry pick fixes for witness item limit #25

Merged
merged 2 commits into from Mar 29, 2023

Conversation

Roasbeef and others added 2 commits February 19, 2023 17:27
In this commit, we fix a bug that would cause nodes to be unable to
parse a given block from the wire. The block would be properly accepted
if fed in via other mechanisms.

The issue here is that the old checks for the maximum witness size,
circa segwit v0 where placed in the wire package _as well_ as the tx
engine. This check should only be in the engine, since it's properly
gated by other related scrip validation flags.

The fix itself is simple: limit witnesses only based on the maximum
block size in bytes, or ~4MB.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4219404336

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.0%) to 84.479%

Totals Coverage Status
Change from base Build 2535198921: -0.0%
Covered Lines: 430
Relevant Lines: 509

💛 - Coveralls

@chappjc
Copy link

chappjc commented Mar 29, 2023

@losh11 I can confirm that this diff is the combination of https://github.com/btcsuite/btcd/pull/1896/files and https://github.com/btcsuite/btcd/pull/1907/files, and that these bugs are presently bricking ltcd, and ltcd/wire's ability to deserialize transactions and blocks, which in turn also breaks ltcwallet and the neutrino client.

[ERR] CORE[ltc][NTRNO]: Can't read message from x.x.x.x:9333 (outbound): readScript: script witness item is larger than the max allowed size [count 52514, max 11000]
...
[ERR] CORE[ltc][NTRNO]: unable to get filter for hash=3efa45d0e3a2011ae1a4eed4b4107aaaa92607f4a94a7a77d86afa4c3ec4f0e1, retrying: unable to fetch cfilter
panic: unable to synchronize wallet to chain: unable to perform wallet recovery: couldn't retrieve block 8fd248d1d7708eb988da1f7a15f911aa1f36f828925a8d1552ae5d4e20e733b6 from network

I have tested, and this PR fixes the issues, and is really critical to any apps that use ltcd/wire. Thanks for merging it.

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

6 participants