-
Notifications
You must be signed in to change notification settings - Fork 232
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
Don't ban remote peer when ckb_vm received Ctrl-C signal when processing chunk_tx #4702
Conversation
753b86c
to
76b0438
Compare
seems not a proper PR title. |
ckb_vm::Error::External("stopped")
return ErrorKind::Internal
instead of ErrorKind::Script
ckb_vm::Error::External("stopped")
return ErrorKind::Internal
instead of ErrorKind::Script
Got it, I'll update the title. Any suggestions? |
Need to create a new Error to handle this case: |
3779db3
to
cf10772
Compare
cf10772
to
a724ef7
Compare
@@ -1180,6 +1180,7 @@ where | |||
let mut scheduler = Scheduler::new(tx_data, version, self.syscalls_generator.clone()); | |||
let map_vm_internal_error = |error: VMInternalError| match error { | |||
VMInternalError::CyclesExceeded => ScriptError::ExceededMaximumCycles(max_cycles), | |||
VMInternalError::External(reason) if reason.eq("stopped") => ScriptError::Interrupts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's other reason may make VM scheduler return VMInternalError::External
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
script/src/syscalls/debugger.rs
48: .map_err(|e| VMError::External(format!("String from buffer {e:?}")))?;
script/src/syscalls/mod.rs
126: _ => Err(Error::External(format!("CellField parse_from_u64 {i}"))),
148: _ => Err(Error::External(format!("HeaderField parse_from_u64 {i}"))),
164: _ => Err(Error::External(format!("InputField parse_from_u64 {i}"))),
197: _ => Err(Error::External(format!("SourceEntry parse_from_u64 {i}"))),
243: _ => Err(Error::External(format!("Place parse_from_u64 {i}"))),
how can we add a unit test for this, it seems hard but worth having a try. |
Sure, I will add unit test. |
3918966
to
86b3c08
Compare
86b3c08
to
64ef41a
Compare
…tead of ErrorKind::Script
Signed-off-by: Eval EXEC <[email protected]>
64ef41a
to
5f70ba5
Compare
What problem does this PR solve?
Issue Number: close #4701
Related changes
ckb_vm::Error::External("stopped")
returnErrorKind::Internal
instead ofErrorKind::Script
return
ErrorKind::Internal
then ckb will not think the tx is malformled:ckb/util/types/src/core/tx_pool.rs
Lines 68 to 84 in 8cb49e4
Check List
Tests
Side effects
Release note