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

Don't ban remote peer when ckb_vm received Ctrl-C signal when processing chunk_tx #4702

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

eval-exec
Copy link
Collaborator

@eval-exec eval-exec commented Oct 29, 2024

What problem does this PR solve?

Issue Number: close #4701

Related changes

  • let ckb_vm::Error::External("stopped") return ErrorKind::Internal instead of ErrorKind::Script

return ErrorKind::Internal then ckb will not think the tx is malformled:

fn is_malformed_from_verification(error: &Error) -> bool {
match error.kind() {
ErrorKind::Transaction => error
.downcast_ref::<TransactionError>()
.expect("error kind checked")
.is_malformed_tx(),
ErrorKind::Script => true,
ErrorKind::Internal => {
error
.downcast_ref::<InternalError>()
.expect("error kind checked")
.kind()
== InternalErrorKind::CapacityOverflow
}
_ => false,
}
}

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • None

Release note

Title Only: Include only the PR title in the release note.

@eval-exec eval-exec force-pushed the exec/ignore-ctrl-c-signal-cause-chunk-stop branch from 3ed164e to 753b86c Compare October 29, 2024 08:05
@eval-exec eval-exec force-pushed the exec/ignore-ctrl-c-signal-cause-chunk-stop branch from 753b86c to 76b0438 Compare October 29, 2024 08:06
@chenyukang
Copy link
Collaborator

seems not a proper PR title.

@eval-exec eval-exec changed the title let ckb_vm::Error::External("stopped") return ErrorKind::Internal instead of ErrorKind::Script let ckb_vm::Error::External("stopped") return ErrorKind::Internal instead of ErrorKind::Script Oct 29, 2024
@eval-exec eval-exec marked this pull request as ready for review October 29, 2024 08:07
@eval-exec eval-exec requested a review from a team as a code owner October 29, 2024 08:07
@eval-exec eval-exec requested review from quake and removed request for a team October 29, 2024 08:07
@eval-exec eval-exec changed the title let ckb_vm::Error::External("stopped") return ErrorKind::Internal instead of ErrorKind::Script Don't ban remote peer when ckb_vm received Ctrl-C signal when processing chunk_tx Oct 29, 2024
@eval-exec
Copy link
Collaborator Author

seems not a proper PR title.

Got it, I'll update the title. Any suggestions?

@eval-exec
Copy link
Collaborator Author

Need to create a new Error to handle this case:InternalErrorKind::Interrupts

@eval-exec eval-exec closed this Oct 30, 2024
@eval-exec eval-exec reopened this Oct 30, 2024
@eval-exec eval-exec marked this pull request as draft October 30, 2024 02:42
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.

Avoid Banning Peer on ckb_vm::Error::External Triggered by Ctrl-C Signal
2 participants