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

fix: add headers limit when reorg #40

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Conversation

EthanYuan
Copy link
Collaborator

When a block storm occurs on testnet 3, a reorg might require rolling back a large number of blocks. If no limit is applied, the witness size could even exceed the 32k limit, causing the CKB transaction to fail.

This PR reuses the same limiting parameters as the update.

[2024-10-09T11:52:19Z DEBUG reqwest::connect] starting new connection: https://testnet.ckb.dev/
Error: ckb rpc error: jsonrpc error: `Server error: TransactionFailedToVerify: Script(TransactionScriptError { source: Inputs[0].Lock, cause: ValidationFailure: see error code -22 on page https://nervosnetwork.github.io/ckb-script-error-codes/by-type-hash/9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8.html#-22 })`

Caused by:
    0: jsonrpc error: `Server error: TransactionFailedToVerify: Script(TransactionScriptError { source: Inputs[0].Lock, cause: ValidationFailure: see error code -22 on page https://nervosnetwork.github.io/ckb-script-error-codes/by-type-hash/9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8.html#-22 })`
    1: Server error: TransactionFailedToVerify: Script(TransactionScriptError { source: Inputs[0].Lock, cause: ValidationFailure: see error code -22 on page https://nervosnetwork.github.io/ckb-script-error-codes/by-type-hash/9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8.html#-22 })
-22
Witness too long. The system script has a fixed upper bound on the accepted witness size(32K right now). If your witness is too big(for example, an attacker includes too much witness data), this would be returned.

@EthanYuan EthanYuan requested review from Flouse and jjyr October 11, 2024 02:40
@EthanYuan EthanYuan changed the title add headers limit when reorg. fix: add headers limit when reorg Oct 11, 2024
@EthanYuan EthanYuan merged commit 7f774ad into utxostack:master Oct 11, 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