Commit d0a63191 authored by clabby's avatar clabby Committed by GitHub

feat(ctb): Clock extensions (#10182)

* feat(ctb): Clock extensions

* Add configurable clock extension immutable

locks,bindings,etc.

comment fixes

x

* `clockExtension` config checks

* feat(ctb): Enforce max supported depth in `FaultDisputeGame` constructor

## Overview

Enforces the max supported depth of the `LibPosition` library's
implemented functionality on the `Position` type in the
`FaultDisputeGame`'s constructor

* use clock dur * 2 in bond monitor
parent 34a44375
......@@ -130,7 +130,7 @@ def init_devnet_l1_deploy_config(paths, update_timestamp=False):
deploy_config['l1GenesisBlockTimestamp'] = '{:#x}'.format(int(time.time()))
if DEVNET_FPAC:
deploy_config['useFaultProofs'] = True
deploy_config['faultGameMaxDuration'] = 10
deploy_config['faultGameMaxClockDuration'] = 10
deploy_config['faultGameWithdrawalDelay'] = 0
if DEVNET_PLASMA:
deploy_config['usePlasma'] = True
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,7 +13,7 @@ const FaultDisputeGameStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contr
var FaultDisputeGameStorageLayout = new(solc.StorageLayout)
var FaultDisputeGameDeployedBin = "0x6080604052600436106102175760003560e01c80638b85902b11610126578063d5d44d80116100a7578063ec5e630811610079578063fa24f74311610061578063fa24f743146107ec578063fa315aa914610810578063fdffbb281461084357005b8063ec5e630814610799578063f8f43ff6146107cc57005b8063d5d44d80146106e6578063d6ae3cd514610713578063d8cc1a3c14610746578063e1f0c3761461076657005b8063bd8da956116100f8578063c55cd0c7116100e0578063c55cd0c714610628578063c6f0308c1461063b578063cf09e0d0146106c557005b8063bd8da956146105e8578063c395e1ca1461060857005b80638b85902b146104f45780638d450a9514610534578063bbdc02db14610567578063bcef3b55146105a857005b806354fd4d50116101b0578063632247ea1161018257806370872aa51161016a57806370872aa5146104c25780638129fc1c146104d75780638980e0cc146104df57005b8063632247ea1461046f5780636361506d1461048257005b806354fd4d50146103b457806357da950e1461040a578063609d33341461043a57806360e274641461044f57005b806335fef567116101e957806335fef567146102da57806337b1b229146102ed5780633a7684631461034e5780633fc8cef31461038157005b806319effeb414610220578063200d2ed21461026b57806325fc2ace146102a65780632810e1d6146102c557005b3661021e57005b005b34801561022c57600080fd5b5060005461024d9068010000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561027757600080fd5b5060005461029990700100000000000000000000000000000000900460ff1681565b6040516102629190613f61565b3480156102b257600080fd5b506007545b604051908152602001610262565b3480156102d157600080fd5b50610299610863565b61021e6102e8366004613fa2565b610b08565b3480156102f957600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90033560601c5b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610262565b34801561035a57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610329565b34801561038d57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610329565b3480156103c057600080fd5b506103fd6040518060400160405280600681526020017f302e31352e30000000000000000000000000000000000000000000000000000081525081565b604051610262919061402f565b34801561041657600080fd5b50600754600854610425919082565b60408051928352602083019190915201610262565b34801561044657600080fd5b506103fd610b1d565b34801561045b57600080fd5b5061021e61046a366004614067565b610b2b565b61021e61047d3660046140a0565b610cd7565b34801561048e57600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c9003603401356102b7565b3480156104ce57600080fd5b506008546102b7565b61021e611484565b3480156104eb57600080fd5b506001546102b7565b34801561050057600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c9003605401356102b7565b34801561054057600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102b7565b34801561057357600080fd5b5060405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610262565b3480156105b457600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c9003601401356102b7565b3480156105f457600080fd5b5061024d6106033660046140d5565b6119b8565b34801561061457600080fd5b506102b76106233660046140ee565b611b77565b61021e610636366004613fa2565b611d5a565b34801561064757600080fd5b5061065b6106563660046140d5565b611d66565b6040805163ffffffff909816885273ffffffffffffffffffffffffffffffffffffffff968716602089015295909416948601949094526fffffffffffffffffffffffffffffffff9182166060860152608085015291821660a08401521660c082015260e001610262565b3480156106d157600080fd5b5060005461024d9067ffffffffffffffff1681565b3480156106f257600080fd5b506102b7610701366004614067565b60026020526000908152604090205481565b34801561071f57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102b7565b34801561075257600080fd5b5061021e610761366004614169565b611dfd565b34801561077257600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061024d565b3480156107a557600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102b7565b3480156107d857600080fd5b5061021e6107e73660046141f3565b61242c565b3480156107f857600080fd5b50610801612889565b6040516102629392919061421f565b34801561081c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102b7565b34801561084f57600080fd5b5061021e61085e3660046140d5565b6128e9565b600080600054700100000000000000000000000000000000900460ff16600281111561089157610891613f32565b146108c8576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805260056020527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc5460ff1661092c576040517f9a07664600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660016000815481106109585761095861424d565b6000918252602090912060059091020154640100000000900473ffffffffffffffffffffffffffffffffffffffff1614610993576001610996565b60025b6000805467ffffffffffffffff421668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff82168117835592935083927fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffff000000000000000000ffffffffffffffff90911617700100000000000000000000000000000000836002811115610a4757610a47613f32565b021790556002811115610a5c57610a5c613f32565b6040517f5e186f09b9c93491f14e277eea7faa5de6a2d4bda75a79af7a3684fbfb42da6090600090a27f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663838c2d1e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610aed57600080fd5b505af1158015610b01573d6000803e3d6000fd5b5050505090565b610b1482826000610cd7565b5050565b905090565b6060610b1860546020612d05565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040812080549082905590819003610b90576040517f17bfe5f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063f3fef3a390604401600060405180830381600087803b158015610c2057600080fd5b505af1158015610c34573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610c92576040519150601f19603f3d011682016040523d82523d6000602084013e610c97565b606091505b5050905080610cd2576040517f83e6cc6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60008054700100000000000000000000000000000000900460ff166002811115610d0357610d03613f32565b14610d3a576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018481548110610d4f57610d4f61424d565b600091825260208083206040805160e0810182526005909402909101805463ffffffff808216865273ffffffffffffffffffffffffffffffffffffffff6401000000009092048216948601949094526001820154169184019190915260028101546fffffffffffffffffffffffffffffffff90811660608501526003820154608085015260049091015480821660a0850181905270010000000000000000000000000000000090910490911660c0840152919350909190610e149083908690612d5716565b90506000610eb4826fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff169050861580610eef5750610eec7f000000000000000000000000000000000000000000000000000000000000000060026142ab565b81145b8015610ef9575084155b15610f30576040517fa42637bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000811115610f8a576040517f56f57b2b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fb57f000000000000000000000000000000000000000000000000000000000000000060016142ab565b8103610fc757610fc786888588612d5f565b34610fd183611b77565b14611008576040517f8620aa1900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611013886119b8565b90507f000000000000000000000000000000000000000000000000000000000000000060011c677fffffffffffffff1667ffffffffffffffff821603611085576040517f3381d11400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000604082901b42176000898152608086901b6fffffffffffffffffffffffffffffffff8c1617602052604081209192509060008181526003602052604090205490915060ff1615611103576040517f80497e3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016003600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060016040518060e001604052808c63ffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152602001346fffffffffffffffffffffffffffffffff1681526020018b8152602001876fffffffffffffffffffffffffffffffff168152602001846fffffffffffffffffffffffffffffffff16815250908060018154018082558091505060019003906000526020600020906005020160009091909190915060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506080820151816003015560a08201518160040160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060c08201518160040160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055505050600460008b81526020019081526020016000206001808054905061139891906142c3565b81546001810183556000928352602083200155604080517fd0e30db0000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169263d0e30db09234926004808301939282900301818588803b15801561143057600080fd5b505af1158015611444573d6000803e3d6000fd5b50506040513393508c92508d91507f9b3245740ec3b155098a55be84957a4da13eaf7f14a8bc6f53126c0b9350f2be90600090a450505050505050505050565b60065460ff16156114c1576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f7258a80700000000000000000000000000000000000000000000000000000000815263ffffffff7f0000000000000000000000000000000000000000000000000000000000000000166004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690637258a807906024016040805180830381865afa158015611575573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159991906142da565b9092509050816115d5576040517f6a6bc3b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080518082019091528281526020018190526007829055600881905536607a1461160857639824bdab6000526004601cfd5b80367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c900360540135116116a2576040517ff40239db000000000000000000000000000000000000000000000000000000008152367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90036014013560048201526024015b60405180910390fd5b6040805160e08101825263ffffffff8082526000602083018181527ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe369081013560f01c90038035606090811c868801908152346fffffffffffffffffffffffffffffffff81811693890193845260149094013560808901908152600160a08a0181815242871660c08c0190815282548084018455928a529a5160059092027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054995173ffffffffffffffffffffffffffffffffffffffff908116640100000000027fffffffffffffffff000000000000000000000000000000000000000000000000909b1694909c16939093179890981790915592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf787018054918a167fffffffffffffffffffffffff000000000000000000000000000000000000000090921691909117905592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8860180549186167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090921691909117905591517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf985015551955182167001000000000000000000000000000000000295909116949094177fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfa9091015583517fd0e30db000000000000000000000000000000000000000000000000000000000815293517f00000000000000000000000000000000000000000000000000000000000000009092169363d0e30db093926004828101939282900301818588803b15801561193c57600080fd5b505af1158015611950573d6000803e3d6000fd5b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000164267ffffffffffffffff161790555050600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055505050565b600080600054700100000000000000000000000000000000900460ff1660028111156119e6576119e6613f32565b14611a1d576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018381548110611a3257611a3261424d565b600091825260208220600590910201805490925063ffffffff90811614611aa157815460018054909163ffffffff16908110611a7057611a7061424d565b906000526020600020906005020160040160109054906101000a90046fffffffffffffffffffffffffffffffff1690505b6004820154600090611ad990700100000000000000000000000000000000900467ffffffffffffffff165b67ffffffffffffffff1690565b611aed9067ffffffffffffffff16426142c3565b611b0c611acc846fffffffffffffffffffffffffffffffff1660401c90565b67ffffffffffffffff16611b2091906142ab565b9050677fffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000060011c1667ffffffffffffffff8216811015611b6a57809450611b6e565b8194505b50505050919050565b600080611c16836fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1690507f0000000000000000000000000000000000000000000000000000000000000000811115611c75576040517f56f57b2b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b642e90edd00062061a80630bebc2006000611c90838361432d565b9050670de0b6b3a76400006000611cc7827f0000000000000000000000000000000000000000000000000000000000000000614341565b90506000611ce5611ce0670de0b6b3a764000086614341565b612f19565b90506000611cf38484613174565b90506000611d0183836131c3565b90506000611d0e826131f1565b90506000611d2d82611d28670de0b6b3a76400008f614341565b6133d9565b90506000611d3b8b836131c3565b9050611d47818d614341565b9f9e505050505050505050505050505050565b610b1482826001610cd7565b60018181548110611d7657600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015463ffffffff8416955064010000000090930473ffffffffffffffffffffffffffffffffffffffff908116949216926fffffffffffffffffffffffffffffffff91821692918082169170010000000000000000000000000000000090041687565b60008054700100000000000000000000000000000000900460ff166002811115611e2957611e29613f32565b14611e60576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018781548110611e7557611e7561424d565b6000918252602082206005919091020160048101549092506fffffffffffffffffffffffffffffffff16908715821760011b9050611ed47f000000000000000000000000000000000000000000000000000000000000000060016142ab565b611f70826fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1614611faa576040517f5f53dd9800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008089156120a157611ffd7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006142c3565b6001901b61201c846fffffffffffffffffffffffffffffffff16613413565b6fffffffffffffffffffffffffffffffff16612038919061437e565b156120755761206c61205d60016fffffffffffffffffffffffffffffffff8716614392565b865463ffffffff1660006134b2565b60030154612097565b7f00000000000000000000000000000000000000000000000000000000000000005b91508490506120cb565b600385015491506120c861205d6fffffffffffffffffffffffffffffffff861660016143c3565b90505b600882901b60088a8a6040516120e29291906143f7565b6040518091039020901b14612123576040517f696550ff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061212e8c613596565b9050600061213d836003015490565b6040517fe14ced320000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063e14ced32906121b7908f908f908f908f908a90600401614450565b6020604051808303816000875af11580156121d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fa919061448a565b6004850154911491506000906002906122a5906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b612341896fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b61234b91906144a3565b61235591906144c6565b60ff161590508115158103612396576040517ffb4e40dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8754640100000000900473ffffffffffffffffffffffffffffffffffffffff16156123ed576040517f9071e6af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505085547fffffffffffffffff0000000000000000000000000000000000000000ffffffff163364010000000002179095555050505050505050505050565b60008054700100000000000000000000000000000000900460ff16600281111561245857612458613f32565b1461248f576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008061249e866135c5565b935093509350935060006124b4858585856139ce565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015612523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061254791906144e8565b90506001890361263f5773ffffffffffffffffffffffffffffffffffffffff81166352f0f3ad8a846125a3367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90036034013590565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815260048101939093526024830191909152604482015260206064820152608481018a905260a4015b6020604051808303816000875af1158015612615573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612639919061448a565b5061287e565b6002890361266b5773ffffffffffffffffffffffffffffffffffffffff81166352f0f3ad8a84896125a3565b600389036126975773ffffffffffffffffffffffffffffffffffffffff81166352f0f3ad8a84876125a3565b600489036127b35760006126dd6fffffffffffffffffffffffffffffffff85167f0000000000000000000000000000000000000000000000000000000000000000613a8d565b6008546126ea91906142ab565b6126f59060016142ab565b905073ffffffffffffffffffffffffffffffffffffffff82166352f0f3ad8b8560405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526004810192909252602482015260c084901b604482015260086064820152608481018b905260a4016020604051808303816000875af1158015612788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ac919061448a565b505061287e565b6005890361284c576040517f52f0f3ad000000000000000000000000000000000000000000000000000000008152600481018a9052602481018390527f000000000000000000000000000000000000000000000000000000000000000060c01b6044820152600860648201526084810188905273ffffffffffffffffffffffffffffffffffffffff8216906352f0f3ad9060a4016125f6565b6040517fff137e6500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050565b7f0000000000000000000000000000000000000000000000000000000000000000367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90036014013560606128e2610b1d565b9050909192565b60008054700100000000000000000000000000000000900460ff16600281111561291557612915613f32565b1461294c576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600182815481106129615761296161424d565b90600052602060002090600502019050600061297c836119b8565b90507f000000000000000000000000000000000000000000000000000000000000000060011c677fffffffffffffff1667ffffffffffffffff821610156129ef576040517ff2440b5300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526005602052604090205460ff1615612a38576040517ff1a9458100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600460205260409020805480158015612a5557508415155b15612aef578354640100000000900473ffffffffffffffffffffffffffffffffffffffff1660008115612a885781612aa4565b600186015473ffffffffffffffffffffffffffffffffffffffff165b9050612ab08187613b3b565b505050600093845250506005602052506040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60006fffffffffffffffffffffffffffffffff815b83811015612c37576000858281548110612b2057612b2061424d565b6000918252602080832090910154808352600590915260409091205490915060ff16612b78576040517f9a07664600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018281548110612b8d57612b8d61424d565b600091825260209091206005909102018054909150640100000000900473ffffffffffffffffffffffffffffffffffffffff16158015612be6575060048101546fffffffffffffffffffffffffffffffff908116908516115b15612c24576001810154600482015473ffffffffffffffffffffffffffffffffffffffff90911695506fffffffffffffffffffffffffffffffff1693505b505080612c3090614505565b9050612b04565b50612c7f73ffffffffffffffffffffffffffffffffffffffff831615612c5d5782612c79565b600187015473ffffffffffffffffffffffffffffffffffffffff165b87613b3b565b50845473ffffffffffffffffffffffffffffffffffffffff909116640100000000027fffffffffffffffff0000000000000000000000000000000000000000ffffffff90911617909355505050600090815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b604051818152367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90038284820160208401378260208301016000815260208101604052505092915050565b151760011b90565b6000612d7e6fffffffffffffffffffffffffffffffff841660016143c3565b90506000612d8e828660016134b2565b9050600086901a8380612e7a5750612dc760027f000000000000000000000000000000000000000000000000000000000000000061437e565b6004830154600290612e6b906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b612e7591906144c6565b60ff16145b15612ed25760ff811660011480612e94575060ff81166002145b612ecd576040517ff40239db00000000000000000000000000000000000000000000000000000000815260048101889052602401611699565b612f10565b60ff811615612f10576040517ff40239db00000000000000000000000000000000000000000000000000000000815260048101889052602401611699565b50505050505050565b6fffffffffffffffffffffffffffffffff811160071b81811c67ffffffffffffffff1060061b1781811c63ffffffff1060051b1781811c61ffff1060041b1781811c60ff1060031b1760008213612f7857631615e6386000526004601cfd5b7ff8f9f9faf9fdfafbf9fdfcfdfafbfcfef9fafdfafcfcfbfefafafcfbffffffff6f8421084210842108cc6318c6db6d54be83831c1c601f161a1890811b609f90811c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506029190037d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b302017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d90565b60007812725dd1d243aba0e75fe645cc4873f9e65afe688c928e1f218311670de0b6b3a7640000021582026131b157637c5f487d6000526004601cfd5b50670de0b6b3a7640000919091020490565b6000816000190483118202156131e15763bac65e5b6000526004601cfd5b50670de0b6b3a764000091020490565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdc0d0570925a462d7821361321f57919050565b680755bf798b4a1bf1e5821261323d5763a37bfec96000526004601cfd5b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b600061340a670de0b6b3a7640000836133f186612f19565b6133fb919061453d565b61340591906145f9565b6131f1565b90505b92915050565b6000806134a0837e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b600160ff919091161b90920392915050565b600080826134fb576134f66fffffffffffffffffffffffffffffffff86167f0000000000000000000000000000000000000000000000000000000000000000613c34565b613516565b613516856fffffffffffffffffffffffffffffffff16613de4565b90506001848154811061352b5761352b61424d565b906000526020600020906005020191505b60048201546fffffffffffffffffffffffffffffffff82811691161461358e57815460018054909163ffffffff169081106135795761357961424d565b9060005260206000209060050201915061353c565b509392505050565b60008060008060006135a7866135c5565b93509350935093506135bb848484846139ce565b9695505050505050565b60008060008060008590506000600182815481106135e5576135e561424d565b600091825260209091206004600590920201908101549091507f0000000000000000000000000000000000000000000000000000000000000000906136bc906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff16116136f6576040517fb34b5c2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815b60048301547f0000000000000000000000000000000000000000000000000000000000000000906137bd906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff16925082111561383257825463ffffffff166137fc7f000000000000000000000000000000000000000000000000000000000000000060016142ab565b8303613806578391505b600181815481106138195761381961424d565b90600052602060002090600502019350809450506136fa565b600481810154908401546fffffffffffffffffffffffffffffffff91821691166000816fffffffffffffffffffffffffffffffff1661389b613886856fffffffffffffffffffffffffffffffff1660011c90565b6fffffffffffffffffffffffffffffffff1690565b6fffffffffffffffffffffffffffffffff16149050801561396a5760006138d3836fffffffffffffffffffffffffffffffff16613413565b6fffffffffffffffffffffffffffffffff16111561393e57600061391561390d60016fffffffffffffffffffffffffffffffff8616614392565b8960016134b2565b6003810154600490910154909c506fffffffffffffffffffffffffffffffff169a506139449050565b6007549a505b600386015460048701549099506fffffffffffffffffffffffffffffffff1697506139c0565b600061398c61390d6fffffffffffffffffffffffffffffffff851660016143c3565b6003808901546004808b015492840154930154909e506fffffffffffffffffffffffffffffffff9182169d50919b50169850505b505050505050509193509193565b60006fffffffffffffffffffffffffffffffff84168103613a34578282604051602001613a179291909182526fffffffffffffffffffffffffffffffff16602082015260400190565b604051602081830303815290604052805190602001209050613a85565b60408051602081018790526fffffffffffffffffffffffffffffffff8087169282019290925260608101859052908316608082015260a0016040516020818303038152906040528051906020012090505b949350505050565b600080613b1a847e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1690508083036001841b600180831b0386831b17039250505092915050565b60028082015473ffffffffffffffffffffffffffffffffffffffff841660009081526020929092526040822080546fffffffffffffffffffffffffffffffff909216928392613b8b9084906142ab565b90915550506040517f7eee288d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018390527f00000000000000000000000000000000000000000000000000000000000000001690637eee288d90604401600060405180830381600087803b158015613c2057600080fd5b505af1158015612f10573d6000803e3d6000fd5b600081613cd3846fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1611613d0d576040517fb34b5c2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613d1683613de4565b905081613db5826fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff161161340d5761340a613dcb8360016142ab565b6fffffffffffffffffffffffffffffffff831690613e89565b60008119600183011681613e78827e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff169390931c8015179392505050565b600080613f16847e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff169050808303600180821b0385821b179250505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160038310613f9c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b60008060408385031215613fb557600080fd5b50508035926020909101359150565b6000815180845260005b81811015613fea57602081850181015186830182015201613fce565b81811115613ffc576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061340a6020830184613fc4565b73ffffffffffffffffffffffffffffffffffffffff8116811461406457600080fd5b50565b60006020828403121561407957600080fd5b813561408481614042565b9392505050565b8035801515811461409b57600080fd5b919050565b6000806000606084860312156140b557600080fd5b83359250602084013591506140cc6040850161408b565b90509250925092565b6000602082840312156140e757600080fd5b5035919050565b60006020828403121561410057600080fd5b81356fffffffffffffffffffffffffffffffff8116811461408457600080fd5b60008083601f84011261413257600080fd5b50813567ffffffffffffffff81111561414a57600080fd5b60208301915083602082850101111561416257600080fd5b9250929050565b6000806000806000806080878903121561418257600080fd5b863595506141926020880161408b565b9450604087013567ffffffffffffffff808211156141af57600080fd5b6141bb8a838b01614120565b909650945060608901359150808211156141d457600080fd5b506141e189828a01614120565b979a9699509497509295939492505050565b60008060006060848603121561420857600080fd5b505081359360208301359350604090920135919050565b63ffffffff841681528260208201526060604082015260006142446060830184613fc4565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156142be576142be61427c565b500190565b6000828210156142d5576142d561427c565b500390565b600080604083850312156142ed57600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261433c5761433c6142fe565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156143795761437961427c565b500290565b60008261438d5761438d6142fe565b500690565b60006fffffffffffffffffffffffffffffffff838116908316818110156143bb576143bb61427c565b039392505050565b60006fffffffffffffffffffffffffffffffff8083168185168083038211156143ee576143ee61427c565b01949350505050565b8183823760009101908152919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b606081526000614464606083018789614407565b8281036020840152614477818688614407565b9150508260408301529695505050505050565b60006020828403121561449c57600080fd5b5051919050565b600060ff821660ff8416808210156144bd576144bd61427c565b90039392505050565b600060ff8316806144d9576144d96142fe565b8060ff84160691505092915050565b6000602082840312156144fa57600080fd5b815161408481614042565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036145365761453661427c565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561457e5761457e61427c565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156145b9576145b961427c565b600087129250878205871284841616156145d5576145d561427c565b878505871281841616156145eb576145eb61427c565b505050929093029392505050565b600082614608576146086142fe565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561465c5761465c61427c565b50059056fea164736f6c634300080f000a"
var FaultDisputeGameDeployedBin = "0x60806040526004361061022f5760003560e01c80638b85902b11610126578063d5d44d80116100a7578063ec5e630811610079578063fa24f74311610061578063fa24f74314610837578063fa315aa91461085b578063fdffbb281461088e57005b8063ec5e6308146107e4578063f8f43ff61461081757005b8063d5d44d8014610731578063d6ae3cd51461075e578063d8cc1a3c14610791578063dabd396d146107b157005b8063bd8da956116100f8578063c55cd0c7116100e0578063c55cd0c714610673578063c6f0308c14610686578063cf09e0d01461071057005b8063bd8da95614610633578063c395e1ca1461065357005b80638b85902b1461053f5780638d450a951461057f578063bbdc02db146105b2578063bcef3b55146105f357005b806357da950e116101b05780636361506d1161018257806370872aa51161016a57806370872aa51461050d5780638129fc1c146105225780638980e0cc1461052a57005b80636361506d1461049a5780636b6716c0146104da57005b806357da950e14610422578063609d33341461045257806360e2746414610467578063632247ea1461048757005b806335fef567116102015780633a768463116101e95780633a768463146103665780633fc8cef31461039957806354fd4d50146103cc57005b806335fef567146102f257806337b1b2291461030557005b806319effeb414610238578063200d2ed21461028357806325fc2ace146102be5780632810e1d6146102dd57005b3661023657005b005b34801561024457600080fd5b506000546102659068010000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020015b60405180910390f35b34801561028f57600080fd5b506000546102b190700100000000000000000000000000000000900460ff1681565b60405161027a9190614114565b3480156102ca57600080fd5b506007545b60405190815260200161027a565b3480156102e957600080fd5b506102b16108ae565b610236610300366004614155565b610b53565b34801561031157600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90033560601c5b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161027a565b34801561037257600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610341565b3480156103a557600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610341565b3480156103d857600080fd5b506104156040518060400160405280600681526020017f302e31362e31000000000000000000000000000000000000000000000000000081525081565b60405161027a91906141e2565b34801561042e57600080fd5b5060075460085461043d919082565b6040805192835260208301919091520161027a565b34801561045e57600080fd5b50610415610b68565b34801561047357600080fd5b5061023661048236600461421a565b610b76565b610236610495366004614253565b610d22565b3480156104a657600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c9003603401356102cf565b3480156104e657600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610265565b34801561051957600080fd5b506008546102cf565b610236611622565b34801561053657600080fd5b506001546102cf565b34801561054b57600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c9003605401356102cf565b34801561058b57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102cf565b3480156105be57600080fd5b5060405163ffffffff7f000000000000000000000000000000000000000000000000000000000000000016815260200161027a565b3480156105ff57600080fd5b50367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c9003601401356102cf565b34801561063f57600080fd5b5061026561064e366004614288565b611b56565b34801561065f57600080fd5b506102cf61066e3660046142a1565b611d36565b610236610681366004614155565b611f19565b34801561069257600080fd5b506106a66106a1366004614288565b611f25565b6040805163ffffffff909816885273ffffffffffffffffffffffffffffffffffffffff968716602089015295909416948601949094526fffffffffffffffffffffffffffffffff9182166060860152608085015291821660a08401521660c082015260e00161027a565b34801561071c57600080fd5b506000546102659067ffffffffffffffff1681565b34801561073d57600080fd5b506102cf61074c36600461421a565b60026020526000908152604090205481565b34801561076a57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102cf565b34801561079d57600080fd5b506102366107ac36600461431c565b611fbc565b3480156107bd57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610265565b3480156107f057600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102cf565b34801561082357600080fd5b506102366108323660046143a6565b6125eb565b34801561084357600080fd5b5061084c612a4b565b60405161027a939291906143d2565b34801561086757600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006102cf565b34801561089a57600080fd5b506102366108a9366004614288565b612aab565b600080600054700100000000000000000000000000000000900460ff1660028111156108dc576108dc6140e5565b14610913576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805260056020527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc5460ff16610977576040517f9a07664600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660016000815481106109a3576109a36143f7565b6000918252602090912060059091020154640100000000900473ffffffffffffffffffffffffffffffffffffffff16146109de5760016109e1565b60025b6000805467ffffffffffffffff421668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff82168117835592935083927fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffff000000000000000000ffffffffffffffff90911617700100000000000000000000000000000000836002811115610a9257610a926140e5565b021790556002811115610aa757610aa76140e5565b6040517f5e186f09b9c93491f14e277eea7faa5de6a2d4bda75a79af7a3684fbfb42da6090600090a27f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663838c2d1e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b3857600080fd5b505af1158015610b4c573d6000803e3d6000fd5b5050505090565b610b5f82826000610d22565b5050565b905090565b6060610b6360546020612ebd565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040812080549082905590819003610bdb576040517f17bfe5f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063f3fef3a390604401600060405180830381600087803b158015610c6b57600080fd5b505af1158015610c7f573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114610cdd576040519150601f19603f3d011682016040523d82523d6000602084013e610ce2565b606091505b5050905080610d1d576040517f83e6cc6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60008054700100000000000000000000000000000000900460ff166002811115610d4e57610d4e6140e5565b14610d85576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018481548110610d9a57610d9a6143f7565b600091825260208083206040805160e0810182526005909402909101805463ffffffff808216865273ffffffffffffffffffffffffffffffffffffffff6401000000009092048216948601949094526001820154169184019190915260028101546fffffffffffffffffffffffffffffffff90811660608501526003820154608085015260049091015480821660a0850181905270010000000000000000000000000000000090910490911660c0840152919350909190610e5f9083908690612f0f16565b90506000610eff826fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff169050861580610f3a5750610f377f00000000000000000000000000000000000000000000000000000000000000006002614455565b81145b8015610f44575084155b15610f7b576040517fa42637bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000811115610fd5576040517f56f57b2b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110007f00000000000000000000000000000000000000000000000000000000000000006001614455565b81036110125761101286888588612f17565b3461101c83611d36565b14611053576040517f8620aa1900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061105e88611b56565b905067ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116908216036110c6576040517f3381d11400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001667ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016611126919061446d565b67ffffffffffffffff166111418267ffffffffffffffff1690565b67ffffffffffffffff16111561122357600061117e60017f0000000000000000000000000000000000000000000000000000000000000000614496565b83146111b45767ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166111e9565b6111e97f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1660026144ad565b905061121f817f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1661446d565b9150505b6000604082901b42176000898152608086901b6fffffffffffffffffffffffffffffffff8c1617602052604081209192509060008181526003602052604090205490915060ff16156112a1576040517f80497e3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016003600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060016040518060e001604052808c63ffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152602001346fffffffffffffffffffffffffffffffff1681526020018b8152602001876fffffffffffffffffffffffffffffffff168152602001846fffffffffffffffffffffffffffffffff16815250908060018154018082558091505060019003906000526020600020906005020160009091909190915060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506080820151816003015560a08201518160040160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060c08201518160040160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055505050600460008b8152602001908152602001600020600180805490506115369190614496565b81546001810183556000928352602083200155604080517fd0e30db0000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169263d0e30db09234926004808301939282900301818588803b1580156115ce57600080fd5b505af11580156115e2573d6000803e3d6000fd5b50506040513393508c92508d91507f9b3245740ec3b155098a55be84957a4da13eaf7f14a8bc6f53126c0b9350f2be90600090a450505050505050505050565b60065460ff161561165f576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f7258a80700000000000000000000000000000000000000000000000000000000815263ffffffff7f0000000000000000000000000000000000000000000000000000000000000000166004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690637258a807906024016040805180830381865afa158015611713573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173791906144dd565b909250905081611773576040517f6a6bc3b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080518082019091528281526020018190526007829055600881905536607a146117a657639824bdab6000526004601cfd5b80367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90036054013511611840576040517ff40239db000000000000000000000000000000000000000000000000000000008152367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90036014013560048201526024015b60405180910390fd5b6040805160e08101825263ffffffff8082526000602083018181527ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe369081013560f01c90038035606090811c868801908152346fffffffffffffffffffffffffffffffff81811693890193845260149094013560808901908152600160a08a0181815242871660c08c0190815282548084018455928a529a5160059092027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054995173ffffffffffffffffffffffffffffffffffffffff908116640100000000027fffffffffffffffff000000000000000000000000000000000000000000000000909b1694909c16939093179890981790915592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf787018054918a167fffffffffffffffffffffffff000000000000000000000000000000000000000090921691909117905592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8860180549186167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090921691909117905591517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf985015551955182167001000000000000000000000000000000000295909116949094177fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfa9091015583517fd0e30db000000000000000000000000000000000000000000000000000000000815293517f00000000000000000000000000000000000000000000000000000000000000009092169363d0e30db093926004828101939282900301818588803b158015611ada57600080fd5b505af1158015611aee573d6000803e3d6000fd5b5050600080547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000164267ffffffffffffffff161790555050600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055505050565b600080600054700100000000000000000000000000000000900460ff166002811115611b8457611b846140e5565b14611bbb576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018381548110611bd057611bd06143f7565b600091825260208220600590910201805490925063ffffffff90811614611c3f57815460018054909163ffffffff16908110611c0e57611c0e6143f7565b906000526020600020906005020160040160109054906101000a90046fffffffffffffffffffffffffffffffff1690505b6004820154600090611c7790700100000000000000000000000000000000900467ffffffffffffffff165b67ffffffffffffffff1690565b611c8b9067ffffffffffffffff1642614496565b611caa611c6a846fffffffffffffffffffffffffffffffff1660401c90565b67ffffffffffffffff16611cbe9190614455565b905067ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001667ffffffffffffffff168167ffffffffffffffff1611611d0b5780611d2d565b7f00000000000000000000000000000000000000000000000000000000000000005b95945050505050565b600080611dd5836fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1690507f0000000000000000000000000000000000000000000000000000000000000000811115611e34576040517f56f57b2b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b642e90edd00062061a80630bebc2006000611e4f8383614530565b9050670de0b6b3a76400006000611e86827f0000000000000000000000000000000000000000000000000000000000000000614544565b90506000611ea4611e9f670de0b6b3a764000086614544565b6130d1565b90506000611eb2848461332c565b90506000611ec0838361337b565b90506000611ecd826133a9565b90506000611eec82611ee7670de0b6b3a76400008f614544565b613591565b90506000611efa8b8361337b565b9050611f06818d614544565b9f9e505050505050505050505050505050565b610b5f82826001610d22565b60018181548110611f3557600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015463ffffffff8416955064010000000090930473ffffffffffffffffffffffffffffffffffffffff908116949216926fffffffffffffffffffffffffffffffff91821692918082169170010000000000000000000000000000000090041687565b60008054700100000000000000000000000000000000900460ff166002811115611fe857611fe86140e5565b1461201f576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018781548110612034576120346143f7565b6000918252602082206005919091020160048101549092506fffffffffffffffffffffffffffffffff16908715821760011b90506120937f00000000000000000000000000000000000000000000000000000000000000006001614455565b61212f826fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1614612169576040517f5f53dd9800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808915612260576121bc7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000614496565b6001901b6121db846fffffffffffffffffffffffffffffffff166135cb565b6fffffffffffffffffffffffffffffffff166121f79190614581565b156122345761222b61221c60016fffffffffffffffffffffffffffffffff8716614595565b865463ffffffff16600061366a565b60030154612256565b7f00000000000000000000000000000000000000000000000000000000000000005b915084905061228a565b6003850154915061228761221c6fffffffffffffffffffffffffffffffff861660016145be565b90505b600882901b60088a8a6040516122a19291906145f2565b6040518091039020901b146122e2576040517f696550ff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122ed8c61374e565b905060006122fc836003015490565b6040517fe14ced320000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063e14ced3290612376908f908f908f908f908a9060040161464b565b6020604051808303816000875af1158015612395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b99190614685565b600485015491149150600090600290612464906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b612500896fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b61250a919061469e565b61251491906146c1565b60ff161590508115158103612555576040517ffb4e40dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8754640100000000900473ffffffffffffffffffffffffffffffffffffffff16156125ac576040517f9071e6af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505085547fffffffffffffffff0000000000000000000000000000000000000000ffffffff163364010000000002179095555050505050505050505050565b60008054700100000000000000000000000000000000900460ff166002811115612617576126176140e5565b1461264e576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008061265d8661377d565b9350935093509350600061267385858585613b86565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270691906146e3565b9050600189036128015773ffffffffffffffffffffffffffffffffffffffff81166352f0f3ad8a84612765367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90036034013590565b90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815260048101939093526024830191909152604482015260206064820152608481018a905260a4015b6020604051808303816000875af11580156127d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fb9190614685565b50612a40565b6002890361282d5773ffffffffffffffffffffffffffffffffffffffff81166352f0f3ad8a8489612765565b600389036128595773ffffffffffffffffffffffffffffffffffffffff81166352f0f3ad8a8487612765565b6004890361297557600061289f6fffffffffffffffffffffffffffffffff85167f0000000000000000000000000000000000000000000000000000000000000000613c40565b6008546128ac9190614455565b6128b7906001614455565b905073ffffffffffffffffffffffffffffffffffffffff82166352f0f3ad8b8560405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526004810192909252602482015260c084901b604482015260086064820152608481018b905260a4016020604051808303816000875af115801561294a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061296e9190614685565b5050612a40565b60058903612a0e576040517f52f0f3ad000000000000000000000000000000000000000000000000000000008152600481018a9052602481018390527f000000000000000000000000000000000000000000000000000000000000000060c01b6044820152600860648201526084810188905273ffffffffffffffffffffffffffffffffffffffff8216906352f0f3ad9060a4016127b8565b6040517fff137e6500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050505050565b7f0000000000000000000000000000000000000000000000000000000000000000367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c9003601401356060612aa4610b68565b9050909192565b60008054700100000000000000000000000000000000900460ff166002811115612ad757612ad76140e5565b14612b0e576040517f67fe195000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018281548110612b2357612b236143f7565b906000526020600020906005020190506000612b3e83611b56565b905067ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169082161015612ba7576040517ff2440b5300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526005602052604090205460ff1615612bf0576040517ff1a9458100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600460205260409020805480158015612c0d57508415155b15612ca7578354640100000000900473ffffffffffffffffffffffffffffffffffffffff1660008115612c405781612c5c565b600186015473ffffffffffffffffffffffffffffffffffffffff165b9050612c688187613cee565b505050600093845250506005602052506040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60006fffffffffffffffffffffffffffffffff815b83811015612def576000858281548110612cd857612cd86143f7565b6000918252602080832090910154808352600590915260409091205490915060ff16612d30576040517f9a07664600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018281548110612d4557612d456143f7565b600091825260209091206005909102018054909150640100000000900473ffffffffffffffffffffffffffffffffffffffff16158015612d9e575060048101546fffffffffffffffffffffffffffffffff908116908516115b15612ddc576001810154600482015473ffffffffffffffffffffffffffffffffffffffff90911695506fffffffffffffffffffffffffffffffff1693505b505080612de890614700565b9050612cbc565b50612e3773ffffffffffffffffffffffffffffffffffffffff831615612e155782612e31565b600187015473ffffffffffffffffffffffffffffffffffffffff165b87613cee565b50845473ffffffffffffffffffffffffffffffffffffffff909116640100000000027fffffffffffffffff0000000000000000000000000000000000000000ffffffff90911617909355505050600090815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b604051818152367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe81013560f01c90038284820160208401378260208301016000815260208101604052505092915050565b151760011b90565b6000612f366fffffffffffffffffffffffffffffffff841660016145be565b90506000612f468286600161366a565b9050600086901a83806130325750612f7f60027f0000000000000000000000000000000000000000000000000000000000000000614581565b6004830154600290613023906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b61302d91906146c1565b60ff16145b1561308a5760ff81166001148061304c575060ff81166002145b613085576040517ff40239db00000000000000000000000000000000000000000000000000000000815260048101889052602401611837565b6130c8565b60ff8116156130c8576040517ff40239db00000000000000000000000000000000000000000000000000000000815260048101889052602401611837565b50505050505050565b6fffffffffffffffffffffffffffffffff811160071b81811c67ffffffffffffffff1060061b1781811c63ffffffff1060051b1781811c61ffff1060041b1781811c60ff1060031b176000821361313057631615e6386000526004601cfd5b7ff8f9f9faf9fdfafbf9fdfcfdfafbfcfef9fafdfafcfcfbfefafafcfbffffffff6f8421084210842108cc6318c6db6d54be83831c1c601f161a1890811b609f90811c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506029190037d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b302017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d90565b60007812725dd1d243aba0e75fe645cc4873f9e65afe688c928e1f218311670de0b6b3a76400000215820261336957637c5f487d6000526004601cfd5b50670de0b6b3a7640000919091020490565b6000816000190483118202156133995763bac65e5b6000526004601cfd5b50670de0b6b3a764000091020490565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdc0d0570925a462d782136133d757919050565b680755bf798b4a1bf1e582126133f55763a37bfec96000526004601cfd5b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b60006135c2670de0b6b3a7640000836135a9866130d1565b6135b39190614738565b6135bd91906147f4565b6133a9565b90505b92915050565b600080613658837e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b600160ff919091161b90920392915050565b600080826136b3576136ae6fffffffffffffffffffffffffffffffff86167f0000000000000000000000000000000000000000000000000000000000000000613de7565b6136ce565b6136ce856fffffffffffffffffffffffffffffffff16613f97565b9050600184815481106136e3576136e36143f7565b906000526020600020906005020191505b60048201546fffffffffffffffffffffffffffffffff82811691161461374657815460018054909163ffffffff16908110613731576137316143f7565b906000526020600020906005020191506136f4565b509392505050565b600080600080600061375f8661377d565b935093509350935061377384848484613b86565b9695505050505050565b600080600080600085905060006001828154811061379d5761379d6143f7565b600091825260209091206004600590920201908101549091507f000000000000000000000000000000000000000000000000000000000000000090613874906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff16116138ae576040517fb34b5c2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815b60048301547f000000000000000000000000000000000000000000000000000000000000000090613975906fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1692508211156139ea57825463ffffffff166139b47f00000000000000000000000000000000000000000000000000000000000000006001614455565b83036139be578391505b600181815481106139d1576139d16143f7565b90600052602060002090600502019350809450506138b2565b600481810154908401546fffffffffffffffffffffffffffffffff91821691166000816fffffffffffffffffffffffffffffffff16613a53613a3e856fffffffffffffffffffffffffffffffff1660011c90565b6fffffffffffffffffffffffffffffffff1690565b6fffffffffffffffffffffffffffffffff161490508015613b22576000613a8b836fffffffffffffffffffffffffffffffff166135cb565b6fffffffffffffffffffffffffffffffff161115613af6576000613acd613ac560016fffffffffffffffffffffffffffffffff8616614595565b89600161366a565b6003810154600490910154909c506fffffffffffffffffffffffffffffffff169a50613afc9050565b6007549a505b600386015460048701549099506fffffffffffffffffffffffffffffffff169750613b78565b6000613b44613ac56fffffffffffffffffffffffffffffffff851660016145be565b6003808901546004808b015492840154930154909e506fffffffffffffffffffffffffffffffff9182169d50919b50169850505b505050505050509193509193565b60006fffffffffffffffffffffffffffffffff841615613bf35760408051602081018790526fffffffffffffffffffffffffffffffff8087169282019290925260608101859052908316608082015260a00160405160208183030381529060405280519060200120611d2d565b8282604051602001613c219291909182526fffffffffffffffffffffffffffffffff16602082015260400190565b6040516020818303038152906040528051906020012095945050505050565b600080613ccd847e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1690508083036001841b600180831b0386831b17039250505092915050565b60028082015473ffffffffffffffffffffffffffffffffffffffff841660009081526020929092526040822080546fffffffffffffffffffffffffffffffff909216928392613d3e908490614455565b90915550506040517f7eee288d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018390527f00000000000000000000000000000000000000000000000000000000000000001690637eee288d90604401600060405180830381600087803b158015613dd357600080fd5b505af11580156130c8573d6000803e3d6000fd5b600081613e86846fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff1611613ec0576040517fb34b5c2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613ec983613f97565b905081613f68826fffffffffffffffffffffffffffffffff167e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff16116135c5576135c2613f7e836001614455565b6fffffffffffffffffffffffffffffffff83169061403c565b6000811960018301168161402b827e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff169390931c8015179392505050565b6000806140c9847e09010a0d15021d0b0e10121619031e080c141c0f111807131b17061a05041f7f07c4acdd0000000000000000000000000000000000000000000000000000000067ffffffffffffffff831160061b83811c63ffffffff1060051b1792831c600181901c17600281901c17600481901c17600881901c17601081901c170260fb1c1a1790565b60ff169050808303600180821b0385821b179250505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b602081016003831061414f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000806040838503121561416857600080fd5b50508035926020909101359150565b6000815180845260005b8181101561419d57602081850181015186830182015201614181565b818111156141af576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006135c26020830184614177565b73ffffffffffffffffffffffffffffffffffffffff8116811461421757600080fd5b50565b60006020828403121561422c57600080fd5b8135614237816141f5565b9392505050565b8035801515811461424e57600080fd5b919050565b60008060006060848603121561426857600080fd5b833592506020840135915061427f6040850161423e565b90509250925092565b60006020828403121561429a57600080fd5b5035919050565b6000602082840312156142b357600080fd5b81356fffffffffffffffffffffffffffffffff8116811461423757600080fd5b60008083601f8401126142e557600080fd5b50813567ffffffffffffffff8111156142fd57600080fd5b60208301915083602082850101111561431557600080fd5b9250929050565b6000806000806000806080878903121561433557600080fd5b863595506143456020880161423e565b9450604087013567ffffffffffffffff8082111561436257600080fd5b61436e8a838b016142d3565b9096509450606089013591508082111561438757600080fd5b5061439489828a016142d3565b979a9699509497509295939492505050565b6000806000606084860312156143bb57600080fd5b505081359360208301359350604090920135919050565b63ffffffff84168152826020820152606060408201526000611d2d6060830184614177565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561446857614468614426565b500190565b600067ffffffffffffffff8381169083168181101561448e5761448e614426565b039392505050565b6000828210156144a8576144a8614426565b500390565b600067ffffffffffffffff808316818516818304811182151516156144d4576144d4614426565b02949350505050565b600080604083850312156144f057600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261453f5761453f614501565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561457c5761457c614426565b500290565b60008261459057614590614501565b500690565b60006fffffffffffffffffffffffffffffffff8381169083168181101561448e5761448e614426565b60006fffffffffffffffffffffffffffffffff8083168185168083038211156145e9576145e9614426565b01949350505050565b8183823760009101908152919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60608152600061465f606083018789614602565b8281036020840152614672818688614602565b9150508260408301529695505050505050565b60006020828403121561469757600080fd5b5051919050565b600060ff821660ff8416808210156146b8576146b8614426565b90039392505050565b600060ff8316806146d4576146d4614501565b8060ff84160691505092915050565b6000602082840312156146f557600080fd5b8151614237816141f5565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361473157614731614426565b5060010190565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561477957614779614426565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156147b4576147b4614426565b600087129250878205871284841616156147d0576147d0614426565b878505871281841616156147e6576147e6614426565b505050929093029392505050565b60008261480357614803614501565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561485757614857614426565b50059056fea164736f6c634300080f000a"
func init() {
......
......@@ -210,10 +210,12 @@ type DeployConfig struct {
// supports. Ideally, this should be conservatively set so that there is always enough
// room for a full Cannon trace.
FaultGameMaxDepth uint64 `json:"faultGameMaxDepth"`
// FaultGameMaxDuration is the maximum amount of time (in seconds) that the fault dispute
// game can run for before it is ready to be resolved. Each side receives half of this value
// on their chess clock at the inception of the dispute.
FaultGameMaxDuration uint64 `json:"faultGameMaxDuration"`
// FaultGameClockExtension is the amount of time that the dispute game will set the potential grandchild claim's,
// clock to, if the remaining time is less than this value at the time of a claim's creation.
FaultGameClockExtension uint64 `json:"faultGameClockExtension"`
// FaultGameMaxClockDuration is the maximum amount of time that may accumulate on a team's chess clock before they
// may no longer respond.
FaultGameMaxClockDuration uint64 `json:"faultGameMaxClockDuration"`
// FaultGameGenesisBlock is the block number for genesis.
FaultGameGenesisBlock uint64 `json:"faultGameGenesisBlock"`
// FaultGameGenesisOutputRoot is the output root for the genesis block.
......
......@@ -69,7 +69,8 @@
"fundDevAccounts": true,
"faultGameAbsolutePrestate": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameMaxDepth": 63,
"faultGameMaxDuration": 604800,
"faultGameClockExtension": 10800,
"faultGameMaxClockDuration": 302400,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameSplitDepth": 0,
......
......@@ -33,17 +33,17 @@ type ClaimLoader interface {
}
type Agent struct {
metrics metrics.Metricer
systemClock clock.Clock
l1Clock types.ClockReader
solver *solver.GameSolver
loader ClaimLoader
responder Responder
selective bool
claimants []common.Address
maxDepth types.Depth
gameDuration time.Duration
log log.Logger
metrics metrics.Metricer
systemClock clock.Clock
l1Clock types.ClockReader
solver *solver.GameSolver
loader ClaimLoader
responder Responder
selective bool
claimants []common.Address
maxDepth types.Depth
maxClockDuration time.Duration
log log.Logger
}
func NewAgent(
......@@ -52,7 +52,7 @@ func NewAgent(
l1Clock types.ClockReader,
loader ClaimLoader,
maxDepth types.Depth,
gameDuration time.Duration,
maxClockDuration time.Duration,
trace types.TraceAccessor,
responder Responder,
log log.Logger,
......@@ -60,17 +60,17 @@ func NewAgent(
claimants []common.Address,
) *Agent {
return &Agent{
metrics: m,
systemClock: systemClock,
l1Clock: l1Clock,
solver: solver.NewGameSolver(maxDepth, trace),
loader: loader,
responder: responder,
selective: selective,
claimants: claimants,
maxDepth: maxDepth,
gameDuration: gameDuration,
log: log,
metrics: m,
systemClock: systemClock,
l1Clock: l1Clock,
solver: solver.NewGameSolver(maxDepth, trace),
loader: loader,
responder: responder,
selective: selective,
claimants: claimants,
maxDepth: maxDepth,
maxClockDuration: maxClockDuration,
log: log,
}
}
......@@ -163,11 +163,10 @@ func (a *Agent) tryResolveClaims(ctx context.Context) error {
if len(claims) == 0 {
return errNoResolvableClaims
}
maxChessTime := a.gameDuration / 2
var resolvableClaims []uint64
for _, claim := range claims {
if claim.ChessTime(a.l1Clock.Now()) <= maxChessTime {
if claim.ChessTime(a.l1Clock.Now()) <= a.maxClockDuration {
continue
}
if a.selective {
......
......@@ -139,7 +139,7 @@ func TestSkipAttemptingToResolveClaimsWhenClockNotExpired(t *testing.T) {
claimBuilder := test.NewClaimBuilder(t, depth, alphabet.NewTraceProvider(big.NewInt(0), depth))
claimLoader.claims = []types.Claim{
claimBuilder.CreateRootClaim(test.WithExpiredClock(agent.gameDuration)),
claimBuilder.CreateRootClaim(test.WithExpiredClock(agent.maxClockDuration)),
}
require.NoError(t, agent.Act(context.Background()))
......@@ -170,7 +170,7 @@ func setupTestAgent(t *testing.T) (*Agent, *stubClaimLoader, *stubResponder) {
logger := testlog.Logger(t, log.LevelInfo)
claimLoader := &stubClaimLoader{}
depth := types.Depth(4)
gameDuration := 6 * time.Minute
gameDuration := 3 * time.Minute
provider := alphabet.NewTraceProvider(big.NewInt(0), depth)
responder := &stubResponder{}
systemClock := clock.NewDeterministicClock(time.UnixMilli(120200))
......
......@@ -19,7 +19,7 @@ import (
)
var (
methodGameDuration = "gameDuration"
methodMaxClockDuration = "maxClockDuration"
methodMaxGameDepth = "maxGameDepth"
methodAbsolutePrestate = "absolutePrestate"
methodStatus = "status"
......@@ -107,7 +107,7 @@ func (f *FaultDisputeGameContract) GetBlockRange(ctx context.Context) (prestateB
return
}
// GetGameMetadata returns the game's L1 head, L2 block number, root claim, status, and game duration.
// GetGameMetadata returns the game's L1 head, L2 block number, root claim, status, and max clock duration.
func (f *FaultDisputeGameContract) GetGameMetadata(ctx context.Context, block rpcblock.Block) (common.Hash, uint64, common.Hash, gameTypes.GameStatus, uint64, error) {
defer f.metrics.StartContractRequest("GetGameMetadata")()
results, err := f.multiCaller.Call(ctx, block,
......@@ -115,7 +115,7 @@ func (f *FaultDisputeGameContract) GetGameMetadata(ctx context.Context, block rp
f.contract.Call(methodL2BlockNumber),
f.contract.Call(methodRootClaim),
f.contract.Call(methodStatus),
f.contract.Call(methodGameDuration))
f.contract.Call(methodMaxClockDuration))
if err != nil {
return common.Hash{}, 0, common.Hash{}, 0, 0, fmt.Errorf("failed to retrieve game metadata: %w", err)
}
......@@ -274,11 +274,11 @@ func (f *FaultDisputeGameContract) GetOracle(ctx context.Context) (*PreimageOrac
return vm.Oracle(ctx)
}
func (f *FaultDisputeGameContract) GetGameDuration(ctx context.Context) (time.Duration, error) {
defer f.metrics.StartContractRequest("GetGameDuration")()
result, err := f.multiCaller.SingleCall(ctx, rpcblock.Latest, f.contract.Call(methodGameDuration))
func (f *FaultDisputeGameContract) GetMaxClockDuration(ctx context.Context) (time.Duration, error) {
defer f.metrics.StartContractRequest("GetMaxClockDuration")()
result, err := f.multiCaller.SingleCall(ctx, rpcblock.Latest, f.contract.Call(methodMaxClockDuration))
if err != nil {
return 0, fmt.Errorf("failed to fetch game duration: %w", err)
return 0, fmt.Errorf("failed to fetch max clock duration: %w", err)
}
return time.Duration(result.GetUint64(0)) * time.Second, nil
}
......
......@@ -44,12 +44,12 @@ func TestSimpleGetters(t *testing.T) {
},
},
{
methodAlias: "gameDuration",
method: methodGameDuration,
methodAlias: "maxClockDuration",
method: methodMaxClockDuration,
result: uint64(5566),
expected: 5566 * time.Second,
call: func(game *FaultDisputeGameContract) (any, error) {
return game.GetGameDuration(context.Background())
return game.GetMaxClockDuration(context.Background())
},
},
{
......@@ -341,7 +341,7 @@ func TestGetGameMetadata(t *testing.T) {
stubRpc, contract := setupFaultDisputeGameTest(t)
expectedL1Head := common.Hash{0x0a, 0x0b}
expectedL2BlockNumber := uint64(123)
expectedGameDuration := uint64(456)
expectedMaxClockDuration := uint64(456)
expectedRootClaim := common.Hash{0x01, 0x02}
expectedStatus := types.GameStatusChallengerWon
block := rpcblock.ByNumber(889)
......@@ -349,14 +349,14 @@ func TestGetGameMetadata(t *testing.T) {
stubRpc.SetResponse(fdgAddr, methodL2BlockNumber, block, nil, []interface{}{new(big.Int).SetUint64(expectedL2BlockNumber)})
stubRpc.SetResponse(fdgAddr, methodRootClaim, block, nil, []interface{}{expectedRootClaim})
stubRpc.SetResponse(fdgAddr, methodStatus, block, nil, []interface{}{expectedStatus})
stubRpc.SetResponse(fdgAddr, methodGameDuration, block, nil, []interface{}{expectedGameDuration})
stubRpc.SetResponse(fdgAddr, methodMaxClockDuration, block, nil, []interface{}{expectedMaxClockDuration})
l1Head, l2BlockNumber, rootClaim, status, duration, err := contract.GetGameMetadata(context.Background(), block)
require.NoError(t, err)
require.Equal(t, expectedL1Head, l1Head)
require.Equal(t, expectedL2BlockNumber, l2BlockNumber)
require.Equal(t, expectedRootClaim, rootClaim)
require.Equal(t, expectedStatus, status)
require.Equal(t, expectedGameDuration, duration)
require.Equal(t, expectedMaxClockDuration, duration)
}
func TestGetStartingRootHash(t *testing.T) {
......
......@@ -59,7 +59,7 @@ type GameContract interface {
ClaimLoader
GetStatus(ctx context.Context) (gameTypes.GameStatus, error)
GetMaxGameDepth(ctx context.Context) (types.Depth, error)
GetGameDuration(ctx context.Context) (time.Duration, error)
GetMaxClockDuration(ctx context.Context) (time.Duration, error)
GetOracle(ctx context.Context) (*contracts.PreimageOracleContract, error)
GetL1Head(ctx context.Context) (common.Hash, error)
}
......@@ -104,7 +104,7 @@ func NewGamePlayer(
}, nil
}
gameDuration, err := loader.GetGameDuration(ctx)
maxClockDuration, err := loader.GetMaxClockDuration(ctx)
if err != nil {
return nil, fmt.Errorf("failed to fetch the game duration: %w", err)
}
......@@ -146,7 +146,7 @@ func NewGamePlayer(
return nil, fmt.Errorf("failed to create the responder: %w", err)
}
agent := NewAgent(m, systemClock, l1Clock, loader, gameDepth, gameDuration, accessor, responder, logger, selective, claimants)
agent := NewAgent(m, systemClock, l1Clock, loader, gameDepth, maxClockDuration, accessor, responder, logger, selective, claimants)
return &GamePlayer{
act: agent.Act,
loader: loader,
......
......@@ -63,9 +63,10 @@ func WithParent(claim types.Claim) ClaimOpt {
cfg.parentIdx = claim.ContractIndex
})
}
func WithExpiredClock(gameDuration time.Duration) ClaimOpt {
func WithExpiredClock(maxClockDuration time.Duration) ClaimOpt {
return claimOptFn(func(cfg *claimCfg) {
cfg.clockDuration = gameDuration / 2
cfg.clockDuration = maxClockDuration
})
}
......
......@@ -47,7 +47,7 @@ func (b *Bonds) CheckBonds(games []*types.EnrichedGameData) {
func (b *Bonds) checkCredits(game *types.EnrichedGameData) {
// Check if the max duration has been reached for this game
duration := uint64(b.clock.Now().Unix()) - game.Timestamp
maxDurationReached := duration >= game.Duration
maxDurationReached := duration >= game.MaxClockDuration*2
// Iterate over claims and filter out resolved ones
recipients := make(map[int]common.Address)
......
......@@ -60,7 +60,7 @@ func (c *ClaimMonitor) checkGameClaims(
) {
// Check if the game is in the first half
duration := uint64(c.clock.Now().Unix()) - game.Timestamp
firstHalf := duration <= (game.Duration / 2)
firstHalf := duration <= game.MaxClockDuration
// Iterate over the game's claims
for _, claim := range game.Claims {
......@@ -74,7 +74,7 @@ func (c *ClaimMonitor) checkGameClaims(
c.logger.Error("Claim resolved in the first half of the game duration", "game", game.Proxy, "claimContractIndex", claim.ContractIndex)
}
maxChessTime := time.Duration(game.Duration/2) * time.Second
maxChessTime := time.Duration(game.MaxClockDuration) * time.Second
accumulatedTime := claim.ChessTime(c.clock.Now())
clockExpired := accumulatedTime >= maxChessTime
......
......@@ -53,8 +53,8 @@ func newTestClaimMonitor(t *testing.T) (*ClaimMonitor, *clock.DeterministicClock
cl := clock.NewDeterministicClock(frozen)
metrics := &stubClaimMetrics{}
honestActors := []common.Address{
common.Address{0x01},
common.Address{0x02},
{0x01},
{0x02},
}
return NewClaimMonitor(logger, cl, honestActors, metrics), cl, metrics
}
......@@ -87,11 +87,11 @@ func makeMultipleTestGames(duration uint64) []*types.EnrichedGameData {
func makeTestGame(duration uint64) *types.EnrichedGameData {
return &types.EnrichedGameData{
Duration: duration,
MaxClockDuration: duration / 2,
Recipients: map[common.Address]bool{
common.Address{0x02}: true,
common.Address{0x03}: true,
common.Address{0x04}: true,
{0x02}: true,
{0x03}: true,
{0x04}: true,
},
Claims: []types.EnrichedClaim{
{
......
......@@ -12,8 +12,10 @@ import (
monTypes "github.com/ethereum-optimism/optimism/op-dispute-mon/mon/types"
)
type CreateGameCaller func(game gameTypes.GameMetadata) (GameCaller, error)
type FactoryGameFetcher func(ctx context.Context, blockHash common.Hash, earliestTimestamp uint64) ([]gameTypes.GameMetadata, error)
type (
CreateGameCaller func(game gameTypes.GameMetadata) (GameCaller, error)
FactoryGameFetcher func(ctx context.Context, blockHash common.Hash, earliestTimestamp uint64) ([]gameTypes.GameMetadata, error)
)
type Enricher interface {
Enrich(ctx context.Context, block rpcblock.Block, caller GameCaller, game *monTypes.EnrichedGameData) error
......@@ -66,13 +68,13 @@ func (e *Extractor) enrichGames(ctx context.Context, blockHash common.Hash, game
enrichedClaims[i] = monTypes.EnrichedClaim{Claim: claim}
}
enrichedGame := &monTypes.EnrichedGameData{
GameMetadata: game,
L1Head: l1Head,
L2BlockNumber: l2BlockNum,
RootClaim: rootClaim,
Status: status,
Duration: duration,
Claims: enrichedClaims,
GameMetadata: game,
L1Head: l1Head,
L2BlockNumber: l2BlockNum,
RootClaim: rootClaim,
Status: status,
MaxClockDuration: duration,
Claims: enrichedClaims,
}
if err := e.applyEnrichers(ctx, blockHash, caller, enrichedGame); err != nil {
e.logger.Error("Failed to enrich game", "err", err)
......
......@@ -34,16 +34,16 @@ func (d *DelayCalculator) RecordClaimResolutionDelayMax(games []*types.EnrichedG
func (d *DelayCalculator) getMaxResolutionDelay(game *types.EnrichedGameData) uint64 {
var maxDelay uint64 = 0
for _, claim := range game.Claims {
maxDelay = max(d.getOverflowTime(game.Duration, &claim), maxDelay)
maxDelay = max(d.getOverflowTime(game.MaxClockDuration, &claim), maxDelay)
}
return maxDelay
}
func (d *DelayCalculator) getOverflowTime(maxGameDuration uint64, claim *types.EnrichedClaim) uint64 {
func (d *DelayCalculator) getOverflowTime(maxClockDuration uint64, claim *types.EnrichedClaim) uint64 {
if claim.Resolved {
return 0
}
maxChessTime := time.Duration(maxGameDuration/2) * time.Second
maxChessTime := time.Duration(maxClockDuration) * time.Second
accumulatedTime := claim.ChessTime(d.clock.Now())
if accumulatedTime < maxChessTime {
return 0
......
......@@ -12,8 +12,8 @@ import (
)
var (
maxGameDuration = uint64(960)
frozen = time.Unix(int64(time.Hour.Seconds()), 0)
maxClockDuration = uint64(480)
frozen = time.Unix(int64(time.Hour.Seconds()), 0)
)
func TestDelayCalculator_getOverflowTime(t *testing.T) {
......@@ -22,7 +22,7 @@ func TestDelayCalculator_getOverflowTime(t *testing.T) {
claim := &monTypes.EnrichedClaim{
Resolved: true,
}
delay := d.getOverflowTime(maxGameDuration, claim)
delay := d.getOverflowTime(maxClockDuration, claim)
require.Equal(t, uint64(0), delay)
require.Equal(t, 0, metrics.calls)
})
......@@ -39,14 +39,14 @@ func TestDelayCalculator_getOverflowTime(t *testing.T) {
Clock: types.NewClock(duration, timestamp),
},
}
delay := d.getOverflowTime(maxGameDuration, claim)
delay := d.getOverflowTime(maxClockDuration, claim)
require.Equal(t, uint64(0), delay)
require.Equal(t, 0, metrics.calls)
})
t.Run("OverflowTime", func(t *testing.T) {
d, metrics, cl := setupDelayCalculatorTest(t)
duration := time.Duration(maxGameDuration/2) * time.Second
duration := time.Duration(maxClockDuration) * time.Second
timestamp := cl.Now().Add(4 * -time.Minute)
claim := &monTypes.EnrichedClaim{
Claim: types.Claim{
......@@ -56,7 +56,7 @@ func TestDelayCalculator_getOverflowTime(t *testing.T) {
Clock: types.NewClock(duration, timestamp),
},
}
delay := d.getOverflowTime(maxGameDuration, claim)
delay := d.getOverflowTime(maxClockDuration, claim)
require.Equal(t, uint64(240), delay)
require.Equal(t, 0, metrics.calls)
})
......@@ -79,8 +79,8 @@ func TestDelayCalculator_getMaxResolutionDelay(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
d, metrics, _ := setupDelayCalculatorTest(t)
game := &monTypes.EnrichedGameData{
Claims: test.claims,
Duration: maxGameDuration,
Claims: test.claims,
MaxClockDuration: maxClockDuration,
}
got := d.getMaxResolutionDelay(game)
require.Equal(t, 0, metrics.calls)
......@@ -121,23 +121,23 @@ func setupDelayCalculatorTest(t *testing.T) (*DelayCalculator, *mockDelayMetrics
func createGameWithClaimsList() []*monTypes.EnrichedGameData {
return []*monTypes.EnrichedGameData{
{
Claims: createClaimList()[:1],
Duration: maxGameDuration,
Claims: createClaimList()[:1],
MaxClockDuration: maxClockDuration,
},
{
Claims: createClaimList()[:2],
Duration: maxGameDuration,
Claims: createClaimList()[:2],
MaxClockDuration: maxClockDuration,
},
{
Claims: createClaimList(),
Duration: maxGameDuration,
Claims: createClaimList(),
MaxClockDuration: maxClockDuration,
},
}
}
func createClaimList() []monTypes.EnrichedClaim {
newClock := func(multiplier int) types.Clock {
duration := maxGameDuration / 2
duration := maxClockDuration
timestamp := frozen.Add(-time.Minute * time.Duration(multiplier))
return types.NewClock(time.Duration(duration)*time.Second, timestamp)
}
......
......@@ -52,7 +52,7 @@ func (r *ResolutionMonitor) CheckResolutions(games []*types.EnrichedGameData) {
for _, game := range games {
complete := game.Status != gameTypes.GameStatusInProgress
duration := uint64(r.clock.Now().Unix()) - game.Timestamp
maxDurationReached := duration >= game.Duration
maxDurationReached := duration >= game.MaxClockDuration
status.Inc(complete, maxDurationReached)
}
r.metrics.RecordGameResolutionStatus(true, true, status.completeMaxDuration)
......
......@@ -45,7 +45,7 @@ func (s *stubResolutionMetrics) RecordGameResolutionStatus(complete bool, maxDur
func newTestGames(duration uint64) []*types.EnrichedGameData {
newTestGame := func(duration uint64, status gameTypes.GameStatus) *types.EnrichedGameData {
return &types.EnrichedGameData{Duration: duration, Status: status}
return &types.EnrichedGameData{MaxClockDuration: duration, Status: status}
}
return []*types.EnrichedGameData{
newTestGame(duration, gameTypes.GameStatusInProgress),
......
......@@ -17,13 +17,13 @@ type EnrichedClaim struct {
type EnrichedGameData struct {
types.GameMetadata
L1Head common.Hash
L1HeadNum uint64
L2BlockNumber uint64
RootClaim common.Hash
Status types.GameStatus
Duration uint64
Claims []EnrichedClaim
L1Head common.Hash
L1HeadNum uint64
L2BlockNumber uint64
RootClaim common.Hash
Status types.GameStatus
MaxClockDuration uint64
Claims []EnrichedClaim
// Recipients maps addresses to true if they are a bond recipient in the game.
Recipients map[common.Address]bool
......
......@@ -564,7 +564,7 @@ func (s *CrossLayerUser) ResolveClaim(t Testing, l2TxHash common.Hash) common.Ha
game, err := s.getDisputeGame(t, *params)
require.NoError(t, err)
expiry, err := game.GameDuration(&bind.CallOpts{})
expiry, err := game.MaxClockDuration(&bind.CallOpts{})
require.Nil(t, err)
time.Sleep(time.Duration(expiry) * time.Second)
......
......@@ -32,9 +32,9 @@ func (g *FaultGameHelper) Addr() common.Address {
return g.addr
}
func (g *FaultGameHelper) GameDuration(ctx context.Context) time.Duration {
duration, err := g.game.GameDuration(&bind.CallOpts{Context: ctx})
g.require.NoError(err, "failed to get game duration")
func (g *FaultGameHelper) MaxClockDuration(ctx context.Context) time.Duration {
duration, err := g.game.MaxClockDuration(&bind.CallOpts{Context: ctx})
g.require.NoError(err, "failed to get max clock duration")
return time.Duration(duration) * time.Second
}
......
......@@ -161,9 +161,9 @@ func (g *OutputGameHelper) correctOutputRoot(ctx context.Context, pos types.Posi
return outputRoot
}
func (g *OutputGameHelper) GameDuration(ctx context.Context) time.Duration {
duration, err := g.game.GameDuration(&bind.CallOpts{Context: ctx})
g.require.NoError(err, "failed to get game duration")
func (g *OutputGameHelper) MaxClockDuration(ctx context.Context) time.Duration {
duration, err := g.game.MaxClockDuration(&bind.CallOpts{Context: ctx})
g.require.NoError(err, "failed to get max clock duration")
return time.Duration(duration) * time.Second
}
......
......@@ -67,7 +67,7 @@ func TestOutputAlphabetGame_ChallengerWins(t *testing.T) {
claim.WaitForCountered(ctx)
game.LogGameData(ctx)
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
game.LogGameData(ctx)
......@@ -109,7 +109,7 @@ func TestOutputAlphabetGame_ReclaimBond(t *testing.T) {
balance = game.WethBalance(ctx, game.Addr())
require.Truef(t, balance.Cmp(big.NewInt(0)) > 0, "Expected game balance to be above zero")
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
game.LogGameData(ctx)
......@@ -160,7 +160,7 @@ func TestOutputAlphabetGame_ValidOutputRoot(t *testing.T) {
game.LogGameData(ctx)
}
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusDefenderWins)
}
......@@ -210,7 +210,7 @@ func TestChallengerCompleteExhaustiveDisputeGame(t *testing.T) {
// Wait for 4 blocks of no challenger responses. The challenger may still be stepping on invalid claims at max depth
game.WaitForInactivity(ctx, 4, false)
gameDuration := game.GameDuration(ctx)
gameDuration := game.MaxClockDuration(ctx)
sys.TimeTravelClock.AdvanceTime(gameDuration)
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
......@@ -287,7 +287,7 @@ func TestOutputAlphabetGame_FreeloaderEarnsNothing(t *testing.T) {
}
game.LogGameData(ctx)
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusDefenderWins)
......
......@@ -68,7 +68,7 @@ func TestOutputCannonGame(t *testing.T) {
claim.WaitForCountered(ctx)
game.LogGameData(ctx)
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
}
......@@ -96,7 +96,7 @@ func TestOutputCannon_ChallengeAllZeroClaim(t *testing.T) {
game.LogGameData(ctx)
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
game.LogGameData(ctx)
......@@ -171,7 +171,7 @@ func TestOutputCannonDisputeGame(t *testing.T) {
}
})
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.LogGameData(ctx)
......@@ -208,7 +208,7 @@ func TestOutputCannonDefendStep(t *testing.T) {
}
})
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForInactivity(ctx, 10, true)
......@@ -426,7 +426,7 @@ func TestOutputCannonProposedOutputRootValid(t *testing.T) {
})
// Time travel past when the game will be resolvable.
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForInactivity(ctx, 10, true)
......@@ -493,7 +493,7 @@ func TestOutputCannonPoisonedPostState(t *testing.T) {
claimToIgnore2.RequireOnlyCounteredBy(ctx /* nothing */)
// Time travel past when the game will be resolvable.
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.LogGameData(ctx)
......@@ -543,7 +543,7 @@ func TestDisputeOutputRootBeyondProposedBlock_ValidOutputRoot(t *testing.T) {
correctTrace.StepClaimFails(ctx, claim, false)
// Time travel past when the game will be resolvable.
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusDefenderWins)
......@@ -594,7 +594,7 @@ func TestDisputeOutputRootBeyondProposedBlock_InvalidOutputRoot(t *testing.T) {
claim.WaitForCountered(ctx)
// Time travel past when the game will be resolvable.
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
......@@ -654,7 +654,7 @@ func TestDisputeOutputRoot_ChangeClaimedOutputRoot(t *testing.T) {
claim.WaitForCountered(ctx)
// Time travel past when the game will be resolvable.
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
......@@ -714,7 +714,7 @@ func TestInvalidateUnsafeProposal(t *testing.T) {
})
// Time travel past when the game will be resolvable.
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
......@@ -776,7 +776,7 @@ func TestInvalidateProposalForFutureBlock(t *testing.T) {
})
// Time travel past when the game will be resolvable.
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
sys.TimeTravelClock.AdvanceTime(game.MaxClockDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
......
......@@ -200,7 +200,7 @@ func FinalizeWithdrawal(t *testing.T, cfg SystemConfig, l1Client *ethclient.Clie
proxy, err := bindings.NewFaultDisputeGame(game.DisputeGameProxy, l1Client)
require.Nil(t, err)
expiry, err := proxy.GameDuration(&bind.CallOpts{})
expiry, err := proxy.MaxClockDuration(&bind.CallOpts{})
require.Nil(t, err)
time.Sleep(time.Duration(expiry) * time.Second)
......
......@@ -51,7 +51,8 @@
"recommendedProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98",
"faultGameMaxDepth": 50,
"faultGameMaxDuration": 2400,
"faultGameClockExtension": 0,
"faultGameMaxClockDuration": 1200,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF",
"faultGameSplitDepth": 14,
......
......@@ -45,7 +45,8 @@
"fundDevAccounts": false,
"faultGameAbsolutePrestate": "0x03e1255457128b9afd9acf93239c1d477bdff88624901f9ca8fe0783b756dbe0",
"faultGameMaxDepth": 73,
"faultGameMaxDuration": 604800,
"faultGameClockExtension": 10800,
"faultGameMaxClockDuration": 302400,
"faultGameGenesisBlock": 4061224,
"faultGameGenesisOutputRoot": "0xd08055c58b2c5149565c636b44fad2c25b5ccddef1385a2cb721529d7480b242",
"faultGameSplitDepth": 32,
......
......@@ -47,7 +47,8 @@
"recommendedProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameAbsolutePrestate": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameMaxDepth": 8,
"faultGameMaxDuration": 2400,
"faultGameClockExtension": 0,
"faultGameMaxClockDuration": 1200,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF",
"faultGameSplitDepth": 4,
......
......@@ -70,7 +70,8 @@
"systemConfigStartBlock": 4071248,
"faultGameAbsolutePrestate": "0x031e3b504740d0b1264e8cf72b6dde0d497184cfb3f98e451c6be8b33bd3f808",
"faultGameMaxDepth": 73,
"faultGameMaxDuration": 604800,
"faultGameClockExtension": 10800,
"faultGameMaxClockDuration": 302400,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0x91bd00ecd596a86c9f4e12c0646578e77022881c87c06ec6aa31e656d2730688",
"faultGameSplitDepth": 30,
......
......@@ -45,7 +45,8 @@
"fundDevAccounts": false,
"faultGameAbsolutePrestate": "0x031e3b504740d0b1264e8cf72b6dde0d497184cfb3f98e451c6be8b33bd3f808",
"faultGameMaxDepth": 73,
"faultGameMaxDuration": 604800,
"faultGameClockExtension": 10800,
"faultGameMaxClockDuration": 302400,
"faultGameGenesisBlock": 9496192,
"faultGameGenesisOutputRoot": "0x63b1cda487c072b020a57c1203f7c2921754005cadbd54bed7f558111b8278d8",
"faultGameSplitDepth": 30,
......
......@@ -1363,7 +1363,8 @@ contract Deploy is Deployer {
_absolutePrestate: _params.absolutePrestate,
_maxGameDepth: _params.maxGameDepth,
_splitDepth: cfg.faultGameSplitDepth(),
_gameDuration: Duration.wrap(uint64(cfg.faultGameMaxDuration())),
_clockExtension: Duration.wrap(uint64(cfg.faultGameClockExtension())),
_maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration())),
_vm: _params.faultVm,
_weth: _params.weth,
_anchorStateRegistry: _params.anchorStateRegistry,
......@@ -1378,7 +1379,8 @@ contract Deploy is Deployer {
_absolutePrestate: _params.absolutePrestate,
_maxGameDepth: _params.maxGameDepth,
_splitDepth: cfg.faultGameSplitDepth(),
_gameDuration: Duration.wrap(uint64(cfg.faultGameMaxDuration())),
_clockExtension: Duration.wrap(uint64(cfg.faultGameClockExtension())),
_maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration())),
_vm: _params.faultVm,
_weth: _params.weth,
_anchorStateRegistry: _params.anchorStateRegistry,
......
......@@ -55,7 +55,8 @@ contract DeployConfig is Script {
bytes32 public faultGameGenesisOutputRoot;
uint256 public faultGameMaxDepth;
uint256 public faultGameSplitDepth;
uint256 public faultGameMaxDuration;
uint256 public faultGameClockExtension;
uint256 public faultGameMaxClockDuration;
uint256 public faultGameWithdrawalDelay;
uint256 public preimageOracleMinProposalSize;
uint256 public preimageOracleChallengePeriod;
......@@ -128,7 +129,8 @@ contract DeployConfig is Script {
faultGameAbsolutePrestate = stdJson.readUint(_json, "$.faultGameAbsolutePrestate");
faultGameMaxDepth = stdJson.readUint(_json, "$.faultGameMaxDepth");
faultGameSplitDepth = stdJson.readUint(_json, "$.faultGameSplitDepth");
faultGameMaxDuration = stdJson.readUint(_json, "$.faultGameMaxDuration");
faultGameClockExtension = stdJson.readUint(_json, "$.faultGameClockExtension");
faultGameMaxClockDuration = stdJson.readUint(_json, "$.faultGameMaxClockDuration");
faultGameGenesisBlock = stdJson.readUint(_json, "$.faultGameGenesisBlock");
faultGameGenesisOutputRoot = stdJson.readBytes32(_json, "$.faultGameGenesisOutputRoot");
faultGameWithdrawalDelay = stdJson.readUint(_json, "$.faultGameWithdrawalDelay");
......
......@@ -181,7 +181,8 @@ contract FPACOPS is Deploy, StdAssertions {
FaultDisputeGame gameImpl = FaultDisputeGame(payable(address(dgfProxy.gameImpls(GameTypes.CANNON))));
assertEq(gameImpl.maxGameDepth(), cfg.faultGameMaxDepth());
assertEq(gameImpl.splitDepth(), cfg.faultGameSplitDepth());
assertEq(gameImpl.gameDuration().raw(), cfg.faultGameMaxDuration());
assertEq(gameImpl.clockExtension().raw(), cfg.faultGameClockExtension());
assertEq(gameImpl.maxClockDuration().raw(), cfg.faultGameMaxClockDuration());
assertEq(gameImpl.absolutePrestate().raw(), bytes32(cfg.faultGameAbsolutePrestate()));
// Check the security override yoke configuration.
......@@ -191,7 +192,8 @@ contract FPACOPS is Deploy, StdAssertions {
assertEq(soyGameImpl.challenger(), cfg.l2OutputOracleChallenger());
assertEq(soyGameImpl.maxGameDepth(), cfg.faultGameMaxDepth());
assertEq(soyGameImpl.splitDepth(), cfg.faultGameSplitDepth());
assertEq(soyGameImpl.gameDuration().raw(), cfg.faultGameMaxDuration());
assertEq(soyGameImpl.clockExtension().raw(), cfg.faultGameClockExtension());
assertEq(soyGameImpl.maxClockDuration().raw(), cfg.faultGameMaxClockDuration());
assertEq(soyGameImpl.absolutePrestate().raw(), bytes32(cfg.faultGameAbsolutePrestate()));
// Check the AnchorStateRegistry configuration.
......@@ -211,13 +213,14 @@ contract FPACOPS is Deploy, StdAssertions {
console.log(" 1. Absolute Prestate: %x", cfg.faultGameAbsolutePrestate());
console.log(" 2. Max Depth: %d", cfg.faultGameMaxDepth());
console.log(" 3. Output / Execution split Depth: %d", cfg.faultGameSplitDepth());
console.log(" 4. Game Duration (seconds): %d", cfg.faultGameMaxDuration());
console.log(" 5. L2 Genesis block number: %d", cfg.faultGameGenesisBlock());
console.log(" 6. L2 Genesis output root: %x", uint256(cfg.faultGameGenesisOutputRoot()));
console.log(" 7. Proof Maturity Delay (seconds): ", cfg.proofMaturityDelaySeconds());
console.log(" 8. Dispute Game Finality Delay (seconds): ", cfg.disputeGameFinalityDelaySeconds());
console.log(" 9. Respected Game Type: ", cfg.respectedGameType());
console.log(" 10. Preimage Oracle Min Proposal Size (bytes): ", cfg.preimageOracleMinProposalSize());
console.log(" 11. Preimage Oracle Challenge Period (seconds): ", cfg.preimageOracleChallengePeriod());
console.log(" 4. Clock Extension (seconds): %d", cfg.faultGameClockExtension());
console.log(" 5. Max Clock Duration (seconds): %d", cfg.faultGameMaxClockDuration());
console.log(" 6. L2 Genesis block number: %d", cfg.faultGameGenesisBlock());
console.log(" 7. L2 Genesis output root: %x", uint256(cfg.faultGameGenesisOutputRoot()));
console.log(" 8. Proof Maturity Delay (seconds): ", cfg.proofMaturityDelaySeconds());
console.log(" 9. Dispute Game Finality Delay (seconds): ", cfg.disputeGameFinalityDelaySeconds());
console.log(" 10. Respected Game Type: ", cfg.respectedGameType());
console.log(" 11. Preimage Oracle Min Proposal Size (bytes): ", cfg.preimageOracleMinProposalSize());
console.log(" 12. Preimage Oracle Challenge Period (seconds): ", cfg.preimageOracleChallengePeriod());
}
}
......@@ -91,7 +91,8 @@ config=$(cat << EOL
"faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98",
"faultGameMaxDepth": 44,
"faultGameMaxDuration": 1200,
"faultGameClockExtension": 0,
"faultGameMaxClockDuration": 600,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameSplitDepth": 14,
......
......@@ -116,8 +116,8 @@
"sourceCodeHash": "0xc4dbd17217b63f8117f56f78c213e57dda304fee7577fe296e1d804ebe049542"
},
"src/dispute/FaultDisputeGame.sol": {
"initCodeHash": "0x42c04ec50860cf8f1f772bc77dcbd20e7e06554a0962d16eaad2ee5fd748cfe0",
"sourceCodeHash": "0x8ea9b68ddfc6fce606065a789b7323d8b119aadb162c139f1878a9322b1e892b"
"initCodeHash": "0xf1a4519238b2e5ac5d1ca83c33135dc47e5c38029c82443975cfd00abf76a8bf",
"sourceCodeHash": "0x221732fb84ae56d7c526c2437820ec15cdd3ef293ae47f3383df8c943c737805"
},
"src/dispute/weth/DelayedWETH.sol": {
"initCodeHash": "0x7b6ec89eaec09e369426e73161a9c6932223bb1f974377190c3f6f552995da35",
......
......@@ -23,7 +23,12 @@
},
{
"internalType": "Duration",
"name": "_gameDuration",
"name": "_clockExtension",
"type": "uint64"
},
{
"internalType": "Duration",
"name": "_maxClockDuration",
"type": "uint64"
},
{
......@@ -187,6 +192,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "clockExtension",
"outputs": [
{
"internalType": "Duration",
"name": "clockExtension_",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "createdAt",
......@@ -286,19 +304,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gameDuration",
"outputs": [
{
"internalType": "Duration",
"name": "gameDuration_",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gameType",
......@@ -396,6 +401,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxClockDuration",
"outputs": [
{
"internalType": "Duration",
"name": "maxClockDuration_",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxGameDepth",
......@@ -724,6 +742,11 @@
"name": "IncorrectBondAmount",
"type": "error"
},
{
"inputs": [],
"name": "InvalidClockExtension",
"type": "error"
},
{
"inputs": [],
"name": "InvalidLocalIdent",
......@@ -744,6 +767,11 @@
"name": "InvalidSplitDepth",
"type": "error"
},
{
"inputs": [],
"name": "MaxDepthTooLarge",
"type": "error"
},
{
"inputs": [],
"name": "NoCreditToClaim",
......
......@@ -23,7 +23,12 @@
},
{
"internalType": "Duration",
"name": "_gameDuration",
"name": "_clockExtension",
"type": "uint64"
},
{
"internalType": "Duration",
"name": "_maxClockDuration",
"type": "uint64"
},
{
......@@ -210,6 +215,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "clockExtension",
"outputs": [
{
"internalType": "Duration",
"name": "clockExtension_",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "createdAt",
......@@ -309,19 +327,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gameDuration",
"outputs": [
{
"internalType": "Duration",
"name": "gameDuration_",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gameType",
......@@ -419,6 +424,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxClockDuration",
"outputs": [
{
"internalType": "Duration",
"name": "maxClockDuration_",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxGameDepth",
......@@ -765,6 +783,11 @@
"name": "IncorrectBondAmount",
"type": "error"
},
{
"inputs": [],
"name": "InvalidClockExtension",
"type": "error"
},
{
"inputs": [],
"name": "InvalidLocalIdent",
......@@ -785,6 +808,11 @@
"name": "InvalidSplitDepth",
"type": "error"
},
{
"inputs": [],
"name": "MaxDepthTooLarge",
"type": "error"
},
{
"inputs": [],
"name": "NoCreditToClaim",
......
......@@ -1988,7 +1988,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003c"
}
],
"value": 0
......@@ -2014,7 +2014,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003c"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003d"
}
],
"value": 0
......@@ -2475,7 +2475,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003c"
}
],
"value": 0
......@@ -2553,7 +2553,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003c"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003d"
}
],
"value": 0
......@@ -7246,7 +7246,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
}
],
"value": 0
......@@ -36,8 +36,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
/// this depth, execution trace bisection begins.
uint256 internal immutable SPLIT_DEPTH;
/// @notice The duration of the game.
Duration internal immutable GAME_DURATION;
/// @notice The maximum duration that may accumulate on a team's chess clock before they may no longer respond.
Duration internal immutable MAX_CLOCK_DURATION;
/// @notice An onchain VM that performs single instruction steps on a fault proof program trace.
IBigStepper internal immutable VM;
......@@ -54,6 +54,10 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
/// @notice The chain ID of the L2 network this contract argues about.
uint256 internal immutable L2_CHAIN_ID;
/// @notice The duration of the clock extension. Will be doubled if the grandchild is the root claim of an execution
/// trace bisection subgame.
Duration internal immutable CLOCK_EXTENSION;
/// @notice The global root claim's position is always at gindex 1.
Position internal constant ROOT_POSITION = Position.wrap(1);
......@@ -88,14 +92,15 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
OutputRoot public startingOutputRoot;
/// @notice Semantic version.
/// @custom:semver 0.15.0
string public constant version = "0.15.0";
/// @custom:semver 0.16.1
string public constant version = "0.16.1";
/// @param _gameType The type ID of the game.
/// @param _absolutePrestate The absolute prestate of the instruction trace.
/// @param _maxGameDepth The maximum depth of bisection.
/// @param _splitDepth The final depth of the output bisection portion of the game.
/// @param _gameDuration The duration of the game.
/// @param _clockExtension The clock extension to perform when the remaining duration is less than the extension.
/// @param _maxClockDuration The maximum amount of time that may accumulate on a team's chess clock.
/// @param _vm An onchain VM that performs single instruction steps on an FPP trace.
/// @param _weth WETH contract for holding ETH.
/// @param _anchorStateRegistry The contract that stores the anchor state for each game type.
......@@ -105,20 +110,26 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
Claim _absolutePrestate,
uint256 _maxGameDepth,
uint256 _splitDepth,
Duration _gameDuration,
Duration _clockExtension,
Duration _maxClockDuration,
IBigStepper _vm,
IDelayedWETH _weth,
IAnchorStateRegistry _anchorStateRegistry,
uint256 _l2ChainId
) {
// The max game depth may not be greater than `LibPosition.MAX_POSITION_BITLEN - 1`.
if (_maxGameDepth > LibPosition.MAX_POSITION_BITLEN - 1) revert MaxDepthTooLarge();
// The split depth cannot be greater than or equal to the max game depth.
if (_splitDepth >= _maxGameDepth) revert InvalidSplitDepth();
// The clock extension may not be greater than the max clock duration.
if (_clockExtension.raw() > _maxClockDuration.raw()) revert InvalidClockExtension();
GAME_TYPE = _gameType;
ABSOLUTE_PRESTATE = _absolutePrestate;
MAX_GAME_DEPTH = _maxGameDepth;
SPLIT_DEPTH = _splitDepth;
GAME_DURATION = _gameDuration;
CLOCK_EXTENSION = _clockExtension;
MAX_CLOCK_DURATION = _maxClockDuration;
VM = _vm;
WETH = _weth;
ANCHOR_STATE_REGISTRY = _anchorStateRegistry;
......@@ -261,9 +272,22 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
// parent's clock timestamp.
Duration nextDuration = getChallengerDuration(_challengeIndex);
// INVARIANT: A move can never be made once its clock has exceeded `GAME_DURATION / 2`
// INVARIANT: A move can never be made once its clock has exceeded `MAX_CLOCK_DURATION`
// seconds of time.
if (nextDuration.raw() == GAME_DURATION.raw() >> 1) revert ClockTimeExceeded();
if (nextDuration.raw() == MAX_CLOCK_DURATION.raw()) revert ClockTimeExceeded();
// If the remaining clock time has less than `CLOCK_EXTENSION` seconds remaining, grant the potential
// grandchild's clock `CLOCK_EXTENSION` seconds. This is to ensure that, even if a player has to inherit another
// team's clock to counter a freeloader claim, they will always have enough time to to respond. This extension
// is bounded by the depth of the tree. If the potential grandchild is an execution trace bisection root, the
// clock extension is doubled. This is to allow for extra time for the off-chain challenge agent to generate
// the initial instruction trace on the native FPVM.
if (nextDuration.raw() > MAX_CLOCK_DURATION.raw() - CLOCK_EXTENSION.raw()) {
// If the potential grandchild is an execution trace bisection root, double the clock extension.
uint64 extensionPeriod =
nextPositionDepth == SPLIT_DEPTH - 1 ? CLOCK_EXTENSION.raw() * 2 : CLOCK_EXTENSION.raw();
nextDuration = Duration.wrap(MAX_CLOCK_DURATION.raw() - extensionPeriod);
}
// Construct the next clock with the new duration and the current block timestamp.
Clock nextClock = LibClock.wrap(nextDuration, Timestamp.wrap(uint64(block.timestamp)));
......@@ -387,9 +411,9 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
Duration challengeClockDuration = getChallengerDuration(_claimIndex);
// INVARIANT: Cannot resolve a subgame unless the clock of its would-be counter has expired
// INVARIANT: Assuming ordered subgame resolution, challengeClockDuration is always >= GAME_DURATION / 2 if all
// INVARIANT: Assuming ordered subgame resolution, challengeClockDuration is always >= MAX_CLOCK_DURATION if all
// descendant subgames are resolved
if (challengeClockDuration.raw() < GAME_DURATION.raw() >> 1) revert ClockNotExpired();
if (challengeClockDuration.raw() < MAX_CLOCK_DURATION.raw()) revert ClockNotExpired();
// INVARIANT: Cannot resolve a subgame twice.
if (resolvedSubgames[_claimIndex]) revert ClaimAlreadyResolved();
......@@ -634,7 +658,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
}
/// @notice Returns the amount of time elapsed on the potential challenger to `_claimIndex`'s chess clock. Maxes
/// out at `GAME_DURATION / 2`.
/// out at `MAX_CLOCK_DURATION`.
/// @param _claimIndex The index of the subgame root claim.
/// @return duration_ The time elapsed on the potential challenger to `_claimIndex`'s chess clock.
function getChallengerDuration(uint256 _claimIndex) public view returns (Duration duration_) {
......@@ -655,12 +679,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
// Compute the duration elapsed of the potential challenger's clock.
uint64 challengeDuration =
uint64(parentClock.duration().raw() + (block.timestamp - subgameRootClaim.clock.timestamp().raw()));
uint64 maxClockTime = GAME_DURATION.raw() >> 1;
if (challengeDuration > maxClockTime) {
duration_ = Duration.wrap(maxClockTime);
} else {
duration_ = Duration.wrap(challengeDuration);
}
duration_ = challengeDuration > MAX_CLOCK_DURATION.raw() ? MAX_CLOCK_DURATION : Duration.wrap(challengeDuration);
}
////////////////////////////////////////////////////////////////
......@@ -682,9 +701,14 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
splitDepth_ = SPLIT_DEPTH;
}
/// @notice Returns the game duration.
function gameDuration() external view returns (Duration gameDuration_) {
gameDuration_ = GAME_DURATION;
/// @notice Returns the max clock duration.
function maxClockDuration() external view returns (Duration maxClockDuration_) {
maxClockDuration_ = MAX_CLOCK_DURATION;
}
/// @notice Returns the clock extension constant.
function clockExtension() external view returns (Duration clockExtension_) {
clockExtension_ = CLOCK_EXTENSION;
}
/// @notice Returns the address of the VM.
......@@ -879,10 +903,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
{
// A position of 0 indicates that the starting claim is the absolute prestate. In this special case,
// we do not include the starting claim within the local context hash.
if (_startingPos.raw() == 0) {
uuid_ = Hash.wrap(keccak256(abi.encode(_disputed, _disputedPos)));
} else {
uuid_ = Hash.wrap(keccak256(abi.encode(_starting, _startingPos, _disputed, _disputedPos)));
}
uuid_ = _startingPos.raw() == 0
? Hash.wrap(keccak256(abi.encode(_disputed, _disputedPos)))
: Hash.wrap(keccak256(abi.encode(_starting, _startingPos, _disputed, _disputedPos)));
}
}
......@@ -34,7 +34,8 @@ contract PermissionedDisputeGame is FaultDisputeGame {
/// @param _absolutePrestate The absolute prestate of the instruction trace.
/// @param _maxGameDepth The maximum depth of bisection.
/// @param _splitDepth The final depth of the output bisection portion of the game.
/// @param _gameDuration The duration of the game.
/// @param _clockExtension The clock extension to perform when the remaining duration is less than the extension.
/// @param _maxClockDuration The maximum amount of time that may accumulate on a team's chess clock.
/// @param _vm An onchain VM that performs single instruction steps on an FPP trace.
/// @param _weth WETH contract for holding ETH.
/// @param _anchorStateRegistry The contract that stores the anchor state for each game type.
......@@ -46,7 +47,8 @@ contract PermissionedDisputeGame is FaultDisputeGame {
Claim _absolutePrestate,
uint256 _maxGameDepth,
uint256 _splitDepth,
Duration _gameDuration,
Duration _clockExtension,
Duration _maxClockDuration,
IBigStepper _vm,
IDelayedWETH _weth,
IAnchorStateRegistry _anchorStateRegistry,
......@@ -59,7 +61,8 @@ contract PermissionedDisputeGame is FaultDisputeGame {
_absolutePrestate,
_maxGameDepth,
_splitDepth,
_gameDuration,
_clockExtension,
_maxClockDuration,
_vm,
_weth,
_anchorStateRegistry,
......
......@@ -7,6 +7,10 @@ import "src/libraries/DisputeErrors.sol";
/// @title LibPosition
/// @notice This library contains helper functions for working with the `Position` type.
library LibPosition {
/// @notice the `MAX_POSITION_BITLEN` is the number of bits that the `Position` type, and the implementation of
/// its behavior within this library, can safely support.
uint8 internal constant MAX_POSITION_BITLEN = 126;
/// @notice Computes a generalized index (2^{depth} + indexAtDepth).
/// @param _depth The depth of the position.
/// @param _indexAtDepth The index at the depth of the position.
......
......@@ -91,6 +91,12 @@ error ClaimAboveSplit();
/// depth of the game.
error InvalidSplitDepth();
/// @notice Thrown on deployment if the max clock duration is less than or equal to the clock extension.
error InvalidClockExtension();
/// @notice Thrown on deployment if the max depth is greater than `LibPosition.`
error MaxDepthTooLarge();
/// @notice Thrown when trying to step against a claim for a second time, after it has already been countered with
/// an instruction step.
error DuplicateStep();
......
......@@ -343,7 +343,7 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
_proposedGameIndex = disputeGameFactory.gameCount() - 1;
// Warp beyond the chess clocks and finalize the game.
vm.warp(block.timestamp + game.gameDuration().raw() / 2 + 1 seconds);
vm.warp(block.timestamp + game.maxClockDuration().raw() + 1 seconds);
// Fund the portal so that we can withdraw ETH.
vm.deal(address(optimismPortal2), 0xFFFFFFFF);
......
......@@ -50,7 +50,8 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
_absolutePrestate: absolutePrestate,
_maxGameDepth: 2 ** 3,
_splitDepth: 2 ** 2,
_gameDuration: Duration.wrap(7 days),
_clockExtension: Duration.wrap(3 hours),
_maxClockDuration: Duration.wrap(3.5 days),
_vm: _vm,
_weth: delayedWeth,
_anchorStateRegistry: anchorStateRegistry,
......@@ -67,7 +68,8 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
assertEq(gameProxy.absolutePrestate().raw(), absolutePrestate.raw());
assertEq(gameProxy.maxGameDepth(), 2 ** 3);
assertEq(gameProxy.splitDepth(), 2 ** 2);
assertEq(gameProxy.gameDuration().raw(), 7 days);
assertEq(gameProxy.clockExtension().raw(), 3 hours);
assertEq(gameProxy.maxClockDuration().raw(), 3.5 days);
assertEq(address(gameProxy.vm()), address(_vm));
// Label the proxy
......@@ -100,13 +102,32 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
// `IDisputeGame` Implementation Tests //
////////////////////////////////////////////////////////////////
/// @dev Tests that the constructor of the `FaultDisputeGame` reverts when the `MAX_GAME_DEPTH` parameter is
/// greater than `LibPosition.MAX_POSITION_BITLEN - 1`.
function testFuzz_constructor_maxDepthTooLarge_reverts(uint256 _maxGameDepth) public {
AlphabetVM alphabetVM = new AlphabetVM(absolutePrestate, new PreimageOracle(0, 0));
_maxGameDepth = bound(_maxGameDepth, LibPosition.MAX_POSITION_BITLEN, type(uint256).max - 1);
vm.expectRevert(MaxDepthTooLarge.selector);
new FaultDisputeGame({
_gameType: GAME_TYPE,
_absolutePrestate: absolutePrestate,
_maxGameDepth: _maxGameDepth,
_splitDepth: _maxGameDepth + 1,
_clockExtension: Duration.wrap(3 hours),
_maxClockDuration: Duration.wrap(3.5 days),
_vm: alphabetVM,
_weth: DelayedWETH(payable(address(0))),
_anchorStateRegistry: IAnchorStateRegistry(address(0)),
_l2ChainId: 10
});
}
/// @dev Tests that the constructor of the `FaultDisputeGame` reverts when the `_splitDepth`
/// parameter is greater than or equal to the `MAX_GAME_DEPTH`
function test_constructor_wrongArgs_reverts(uint256 _splitDepth) public {
function testFuzz_constructor_invalidSplitDepth_reverts(uint256 _splitDepth) public {
AlphabetVM alphabetVM = new AlphabetVM(absolutePrestate, new PreimageOracle(0, 0));
// Test that the constructor reverts when the `_splitDepth` parameter is greater than or equal
// to the `MAX_GAME_DEPTH` parameter.
_splitDepth = bound(_splitDepth, 2 ** 3, type(uint256).max);
vm.expectRevert(InvalidSplitDepth.selector);
new FaultDisputeGame({
......@@ -114,7 +135,35 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
_absolutePrestate: absolutePrestate,
_maxGameDepth: 2 ** 3,
_splitDepth: _splitDepth,
_gameDuration: Duration.wrap(7 days),
_clockExtension: Duration.wrap(3 hours),
_maxClockDuration: Duration.wrap(3.5 days),
_vm: alphabetVM,
_weth: DelayedWETH(payable(address(0))),
_anchorStateRegistry: IAnchorStateRegistry(address(0)),
_l2ChainId: 10
});
}
/// @dev Tests that the constructor of the `FaultDisputeGame` reverts when clock extension is greater than the
/// max clock duration.
function testFuzz_constructor_clockExtensionTooLong_reverts(
uint64 _maxClockDuration,
uint64 _clockExtension
)
public
{
AlphabetVM alphabetVM = new AlphabetVM(absolutePrestate, new PreimageOracle(0, 0));
_maxClockDuration = uint64(bound(_maxClockDuration, 0, type(uint64).max - 1));
_clockExtension = uint64(bound(_clockExtension, _maxClockDuration + 1, type(uint64).max));
vm.expectRevert(InvalidClockExtension.selector);
new FaultDisputeGame({
_gameType: GAME_TYPE,
_absolutePrestate: absolutePrestate,
_maxGameDepth: 16,
_splitDepth: 8,
_clockExtension: Duration.wrap(_clockExtension),
_maxClockDuration: Duration.wrap(_maxClockDuration),
_vm: alphabetVM,
_weth: DelayedWETH(payable(address(0))),
_anchorStateRegistry: IAnchorStateRegistry(address(0)),
......@@ -394,6 +443,44 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
assertEq(clock.raw(), LibClock.wrap(Duration.wrap(20), Timestamp.wrap(uint64(block.timestamp))).raw());
}
/// @notice Static unit test that checks proper clock extension.
function test_move_clockExtensionCorrectness_succeeds() public {
(,,,,,, Clock clock) = gameProxy.claimData(0);
assertEq(clock.raw(), LibClock.wrap(Duration.wrap(0), Timestamp.wrap(uint64(block.timestamp))).raw());
Claim claim = _dummyClaim();
uint256 splitDepth = gameProxy.splitDepth();
uint64 halfGameDuration = gameProxy.maxClockDuration().raw();
uint64 clockExtension = gameProxy.clockExtension().raw();
// Make an initial attack against the root claim with 1 second left on the clock. The grandchild should be
// allocated exactly `clockExtension` seconds remaining on their potential clock.
vm.warp(block.timestamp + halfGameDuration - 1 seconds);
uint256 bond = _getRequiredBond(0);
gameProxy.attack{ value: bond }(0, claim);
(,,,,,, clock) = gameProxy.claimData(1);
assertEq(clock.duration().raw(), halfGameDuration - clockExtension);
// Warp ahead to the last second of the root claim defender's clock, and bisect all the way down to the move
// above the `SPLIT_DEPTH`. This warp guarantees that all moves from here on out will have clock extensions.
vm.warp(block.timestamp + halfGameDuration - 1 seconds);
for (uint256 i = 1; i < splitDepth - 2; i++) {
bond = _getRequiredBond(i);
gameProxy.attack{ value: bond }(i, claim);
}
// Warp ahead 1 seconds to have `clockExtension - 1 seconds` left on the next move's clock.
vm.warp(block.timestamp + 1 seconds);
// The move above the split depth's grand child is the execution trace bisection root. The grandchild should
// be allocated `clockExtension * 2` seconds on their potential clock, if currently they have less than
// `clockExtension` seconds left.
bond = _getRequiredBond(splitDepth - 2);
gameProxy.attack{ value: bond }(splitDepth - 2, claim);
(,,,,,, clock) = gameProxy.claimData(splitDepth - 1);
assertEq(clock.duration().raw(), halfGameDuration - clockExtension * 2);
}
/// @dev Tests that an identical claim cannot be made twice. The duplicate claim attempt should
/// revert with the `ClaimAlreadyExists` error.
function test_move_duplicateClaim_reverts() public {
......@@ -1140,7 +1227,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
// Defender's turn
vm.warp(block.timestamp + 3.5 days - 1 seconds);
gameProxy.attack{ value: _getRequiredBond(0) }(0, _dummyClaim());
// Chess time left to attack:
// Chess clock time accumulated:
assertEq(gameProxy.getChallengerDuration(0).raw(), 3.5 days - 1 seconds);
assertEq(gameProxy.getChallengerDuration(1).raw(), 0);
......@@ -1150,7 +1237,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
uint256 expectedBond = _getRequiredBond(0);
vm.expectRevert(ClockTimeExceeded.selector);
gameProxy.attack{ value: expectedBond }(0, _dummyClaim());
// Chess time left to attack:
// Chess clock time accumulated:
assertEq(gameProxy.getChallengerDuration(0).raw(), 3.5 days);
assertEq(gameProxy.getChallengerDuration(1).raw(), 1 seconds);
......@@ -1164,10 +1251,10 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
vm.warp(block.timestamp + 3.5 days - 2 seconds);
// Attack the challenge to the root claim. This should succeed, since the defender clock is not expired.
gameProxy.attack{ value: _getRequiredBond(1) }(1, _dummyClaim());
// Chess time left to attack:
// Chess clock time accumulated:
assertEq(gameProxy.getChallengerDuration(0).raw(), 3.5 days);
assertEq(gameProxy.getChallengerDuration(1).raw(), 3.5 days - 1 seconds);
assertEq(gameProxy.getChallengerDuration(2).raw(), 3.5 days - 1 seconds);
assertEq(gameProxy.getChallengerDuration(2).raw(), 3.5 days - gameProxy.clockExtension().raw());
// Should not be able to resolve any claims yet.
vm.expectRevert(ClockNotExpired.selector);
......@@ -1177,6 +1264,21 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
vm.expectRevert(OutOfOrderResolution.selector);
gameProxy.resolveClaim(0);
vm.warp(block.timestamp + gameProxy.clockExtension().raw() - 1 seconds);
// Should not be able to resolve any claims yet.
vm.expectRevert(ClockNotExpired.selector);
gameProxy.resolveClaim(2);
vm.expectRevert(OutOfOrderResolution.selector);
gameProxy.resolveClaim(1);
vm.expectRevert(OutOfOrderResolution.selector);
gameProxy.resolveClaim(0);
// Chess clock time accumulated:
assertEq(gameProxy.getChallengerDuration(0).raw(), 3.5 days);
assertEq(gameProxy.getChallengerDuration(1).raw(), 3.5 days);
assertEq(gameProxy.getChallengerDuration(2).raw(), 3.5 days - 1 seconds);
// Warp past the challenge period for the root claim defender. Defending the root claim should now revert.
vm.warp(block.timestamp + 1 seconds);
expectedBond = _getRequiredBond(1);
......@@ -1185,7 +1287,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
expectedBond = _getRequiredBond(2);
vm.expectRevert(ClockTimeExceeded.selector); // no further move can be made
gameProxy.attack{ value: expectedBond }(2, _dummyClaim());
// Chess time left to attack:
// Chess clock time accumulated:
assertEq(gameProxy.getChallengerDuration(0).raw(), 3.5 days);
assertEq(gameProxy.getChallengerDuration(1).raw(), 3.5 days);
assertEq(gameProxy.getChallengerDuration(2).raw(), 3.5 days);
......
......@@ -57,7 +57,8 @@ contract PermissionedDisputeGame_Init is DisputeGameFactory_Init {
_absolutePrestate: absolutePrestate,
_maxGameDepth: 2 ** 3,
_splitDepth: 2 ** 2,
_gameDuration: Duration.wrap(7 days),
_clockExtension: Duration.wrap(3 hours),
_maxClockDuration: Duration.wrap(3.5 days),
_vm: _vm,
_weth: _weth,
_anchorStateRegistry: anchorStateRegistry,
......@@ -79,7 +80,7 @@ contract PermissionedDisputeGame_Init is DisputeGameFactory_Init {
assertEq(gameProxy.absolutePrestate().raw(), absolutePrestate.raw());
assertEq(gameProxy.maxGameDepth(), 2 ** 3);
assertEq(gameProxy.splitDepth(), 2 ** 2);
assertEq(gameProxy.gameDuration().raw(), 7 days);
assertEq(gameProxy.maxClockDuration().raw(), 3.5 days);
assertEq(address(gameProxy.vm()), address(_vm));
// Label the proxy
......
......@@ -127,7 +127,7 @@ contract OptimismPortal2_Invariant_Harness is CommonTest {
_proposedGameIndex = disputeGameFactory.gameCount() - 1;
// Warp beyond the finalization period for the dispute game and resolve it.
vm.warp(block.timestamp + game.gameDuration().raw() + 1 seconds);
vm.warp(block.timestamp + (game.maxClockDuration().raw() * 2) + 1 seconds);
game.resolveClaim(0);
game.resolve();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment