Skip to content

Avoid Banning Peer on ckb_vm::Error::External Triggered by Ctrl-C Signal #4701

@eval-exec

Description

@eval-exec

Bug Report

2024-10-29 02:02:47.915 +00:00 GlobalRt-20 INFO ckb_tx_pool::process  after_process Byte32(0x58aff34dd6bbac94032aee41ab59fa6232c4139ea135ffab7f7ed014eb89ac12) SessionId(588) remote reject: Verification failed Script(TransactionScriptError { source: Inputs[0].Type, cause: VM Internal Error: External("stopped") }) 
2024-10-29 02:02:47.915 +00:00 GlobalRt-20 INFO ckb_network::network  Ban peer "/ip4/54.168.12.92/tcp/30967/p2p/QmYx1orST2KkEbwmwGEkpSvcJjVenhKEphXhci85zcg6VX" for 259200 seconds, reason: reject Verification failed Script(TransactionScriptError { source: Inputs[0].Type, cause: VM Internal Error: External("stopped") })

ckb/script/src/verify.rs

Lines 1200 to 1204 in 8cb49e4

ChunkCommand::Stop => {
let exit = Err(ckb_vm::Error::External("stopped".into()));
let _ = finish_tx.send(exit);
return;
}

When chunk_run_with_signal receives ChunkCommand::Stop, it raises ckb_vm::Error::External, leading NetworkState to ban the peer. Since this error can result from a Ctrl-C signal, banning the peer is unnecessary.

Expected Behavior

Handle ckb_vm::Error::External triggered by signals (e.g., Ctrl-C) without banning the peer.

Environment

  • CKB version: 0.119.0
  • Chain: testnet
  • Operating system: [Ubuntu 20.04, macOS 11.4, Windows 10]
  • Arch: x64 [the output of uname -a]
  • Installation: GitHub Release

Metadata

Metadata

Assignees

No one assigned

    Labels

    t:bugType: This doesn't seem right.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions