Godwoken 挑战(challenge-lock)约束Godwoken challenge (challenge-lock) Constraints

来源:godwokenrises/godwoken @c2b1f85 / gwos/contracts/challenge-lock/src/entry.rs + verifications/ · 部署:godwoken-info @8ce6390 mainnet_v1 / testnet_v1_1Source: godwokenrises/godwoken @c2b1f85 / gwos/contracts/challenge-lock/src/entry.rs + verifications/ · deployments: godwoken-info @8ce6390 mainnet_v1 / testnet_v1_1
Lock 脚本Lock script二层 / RollupLayer 2 / Rollup主网Mainnet测试网Testnet开源Open sourceNervos 官方Nervos

1 → 0挑战成立 / 回滚Challenge stands / revert

Inputs 输入Inputs
input[0] rollup cellinput[0] rollup cellCell{ capacity: R, lock: rollup lock (mainnet: omni_lock deployment), type: { codeHash: STATE_VALIDATOR, hashType: type, args: type_id 32B }, data: GlobalState (190B) }
input[1] challenge cellinput[1] challenge cellCell{ capacity: C, lock: CHALLENGE_LOCK(rollup_type_hash ‖ ChallengeLockArgs), type: null, data: 0x }
➜
Outputs 输出Outputs
output[0] rollup cell′output[0] rollup cell′Cell{ capacity: R, lock: rollup lock (mainnet: omni_lock deployment), type: { codeHash: STATE_VALIDATOR, hashType: type, args: type_id 32B }, data: GlobalState (190B) } // witness action: RollupEnterChallenge | RollupRevert

witnesses(WitnessArgs)witnesses (WitnessArgs)

witnesses[rollup 输出]witnesses[rollup output]{ output_type: RollupAction }
args = rollup_type_hash ‖ ChallengeLockArgs(table)args = rollup_type_hash ‖ ChallengeLockArgs (table)
rollup_type_hash32B
target.block_hash32B
target.target_index4B LE
target.target_type1B
rewards_receiver_lockScript
  • rollup_type_hash 32B rollup cell type hashrollup cell type hash (5)
  • target.block_hash 32B 被挑战区块challenged block (32)
  • target.target_index 4B LE 交易 / 提款序号tx / withdrawal index
  • target.target_type 1B 0 交易执行 / 1 交易签名 / 2 提款签名0 tx execution / 1 tx signature / 2 withdrawal signature 0–2 (5)
  • rewards_receiver_lock Script 挑战成功时的奖励接收 lockreward receiver lock if the challenge succeeds (30)
target0x9f…(32B)0300000001 ← tx #3, signature

限制Constraints

  • args:: 合法 ChallengeLockArgsvalid ChallengeLockArgs (5)
  • rollup:: 输出有 rollup cella rollup cell in outputs (9)
  • 动作action:: EnterChallenge / Revert → 通过;SubmitBlock → 失败EnterChallenge / Revert → pass; SubmitBlock → fail (5)

1 → 0取消挑战(证明目标正确)Cancel challenge (prove the target is valid)

Inputs 输入Inputs
input[0] rollup cellinput[0] rollup cellCell{ capacity: R, lock: rollup lock (mainnet: omni_lock deployment), type: { codeHash: STATE_VALIDATOR, hashType: type, args: type_id 32B }, data: GlobalState{ status: halting } }
input[1] challenge cellinput[1] challenge cellCell{ capacity: C, lock: CHALLENGE_LOCK(…), type: null, data: 0x }
input[…] 证明用 cell(按 target_type)input[…] proof cells (per target_type)e.g. a cell under the L2 account lock (eth-account-lock) whose data is the signing message
➜
Outputs 输出Outputs
output[0] rollup cell′output[0] rollup cell′Cell{ capacity: R, lock: rollup lock (mainnet: omni_lock deployment), type: { codeHash: STATE_VALIDATOR, hashType: type, args: type_id 32B }, data: GlobalState (190B) } // witness action: RollupCancelChallenge

cell_depscell_deps

cell_dep:RollupConfig cellcell_dep: RollupConfig cellCell{ data: RollupConfig (molecule) } // load_rollup_config(): found by data hash == GlobalState.rollup_config_hash → else 10
cell_dep:账户 lock / 合约代码cell_dep: account lock / backend codefor signature / execution verification

限制Constraints

  • rollup:: 输入有 rollup cell(读 RollupConfig)a rollup cell in inputs (RollupConfig read) (9 / 10)
  • target_type:: 0–20–2 (5)
  • 验证verify:: 交易执行 / 交易签名 / 提款签名tx execution / tx signature / withdrawal signature (13 / 32 / 41)
部署与来源Deployments & source 未核验unverified
源码source godwokenrises/godwoken@c2b1f850 · gwos/contracts/challenge-lock/src · gwos/contracts/gw-utils/src/error.rs (exact commit read (default-branch HEAD, 2024-01-12). Deployment constants from godwokenrises/godwoken-info @8ce6390133ddfffe9d40d51b7be191418b54958c (mainnet_v1, testnet_v1_1 scripts-deploy-result.json).)
二进制核验binary check 未核验unverified no binary or checksum at the recorded commit matched the deployed data hash (reproducible build not attempted)
网络networkcode_hashcell_deptype_id args数据哈希data hash部署交易deploy tx
mainnet0x628b5f956b46ae27b50819a9ebab79ce5f957e6899ba0c75b8e142de2ed0dcd2 type0x8eca99207a…75a287a6:0 code0xb0cf1d97b3…26cd457e0xbaaae1cc39…61401efd0x8eca99207a…75a287a6 #7469207
testnet0x5a86c3bf1e8648b6a6f8abe6875720ccf9745ab225b68fa7c195f9d6635dea80 type0x15598fb4d3…f712b65d:0 code0x7997689a90…e9b9c2440xbaaae1cc39…61401efd0x15598fb4d3…f712b65d #5292883
链上数据核对于 on-chain data checked 2026-10-21
⚠ 状态:官方已宣布 Godwoken 退役(2025-06-01 起,Nervos Talk “Sunset of Force Bridge and Godwoken”);冻结期限延至 2026-01-01 23:59:59 UTC,之后网络冻结、桥前端下线,v0/v1 RPC 节点已关闭。本页仅作历史 / 审计参考。⚠ Status: Godwoken was officially sunset (from 2025-06-01, Nervos Talk “Sunset of Force Bridge and Godwoken”); the freeze deadline was extended to 2026-01-01 23:59:59 UTC, after which the network froze, the bridge UI went offline and v0/v1 RPC nodes were shut down. This page is for historical / audit reference.
godwoken-info 中有部署,但未在 L1 上找到使用该 lock 的交易(从未发生挑战),tests.json 为空。Deployed per godwoken-info, but no L1 tx using this lock was found (no challenge ever happened); tests.json is empty.
错误码(gw-utils/src/error.rs):1 IndexOutOfBound,2 ItemMissing,3 LengthNotEnough,4 Encoding,5 InvalidArgs,6 InvalidSince,7 InvalidOutput,8 OwnerCellNotFound,9 RollupCellNotFound,10 RollupConfigNotFound,11 ProofNotFound,13 MerkleProof,14 AmountOverflow,15 InsufficientAmount,16/17 Insufficient{Input,Output}FinalizedAssets,18 SMTKeyMissing,19 InvalidStateCheckpoint,20 InvalidBlock,21 InvalidStatus,22 InvalidStakeCellUnlock,23 InvalidPostGlobalState,24 InvalidChallengeCell,25 InvalidStakeCell,26 InvalidDepositCell,27 InvalidWithdrawalCell,28 InvalidCustodianCell,29 InvalidRevertedBlocks,30 InvalidChallengeReward,32 InvalidChallengeTarget,33 InvalidWithdrawalRequest,34 UnknownEOAScript,39 InvalidTypeID,41 WrongSignature,43 RegistryAddressNotFound,45 NotFinalized。Error codes (gw-utils/src/error.rs): 1 IndexOutOfBound, 2 ItemMissing, 3 LengthNotEnough, 4 Encoding, 5 InvalidArgs, 6 InvalidSince, 7 InvalidOutput, 8 OwnerCellNotFound, 9 RollupCellNotFound, 10 RollupConfigNotFound, 11 ProofNotFound, 13 MerkleProof, 14 AmountOverflow, 15 InsufficientAmount, 16/17 Insufficient{Input,Output}FinalizedAssets, 18 SMTKeyMissing, 19 InvalidStateCheckpoint, 20 InvalidBlock, 21 InvalidStatus, 22 InvalidStakeCellUnlock, 23 InvalidPostGlobalState, 24 InvalidChallengeCell, 25 InvalidStakeCell, 26 InvalidDepositCell, 27 InvalidWithdrawalCell, 28 InvalidCustodianCell, 29 InvalidRevertedBlocks, 30 InvalidChallengeReward, 32 InvalidChallengeTarget, 33 InvalidWithdrawalRequest, 34 UnknownEOAScript, 39 InvalidTypeID, 41 WrongSignature, 43 RegistryAddressNotFound, 45 NotFinalized.
GitHub · gpBlockchain/ckb-contract-flow-html