Commit cdca6b75 authored by clabby's avatar clabby

Pos localization

parent cedfb9b7
This diff is collapsed.
...@@ -100,8 +100,8 @@ ...@@ -100,8 +100,8 @@
"sourceCodeHash": "0xa995b54dce03ddf5c9c47451bd7181996b91398ad66b54ab0b8cbf582863a33e" "sourceCodeHash": "0xa995b54dce03ddf5c9c47451bd7181996b91398ad66b54ab0b8cbf582863a33e"
}, },
"src/dispute/OutputBisectionGame.sol": { "src/dispute/OutputBisectionGame.sol": {
"initCodeHash": "0x4db1ded83f8584c983bc6f5d7dfcde9281ba895c793d2fd9f30571c17d93a5fd", "initCodeHash": "0x6efe83410be6fd58eb07a5297492c6a45598d1f0f84d4ec286d93beade28f40f",
"sourceCodeHash": "0x6bd528d5824fe6d093141c07f5590a3c434dbb67f56ab8fa96d7b0a23dac38af" "sourceCodeHash": "0x1cc70ebc403581213a4853e1ef1579abeb63496d0625424fa5b9ac8351b2eeca"
}, },
"src/legacy/DeployerWhitelist.sol": { "src/legacy/DeployerWhitelist.sol": {
"initCodeHash": "0x8de80fb23b26dd9d849f6328e56ea7c173cd9e9ce1f05c9beea559d1720deb3d", "initCodeHash": "0x8de80fb23b26dd9d849f6328e56ea7c173cd9e9ce1f05c9beea559d1720deb3d",
......
...@@ -147,9 +147,11 @@ contract OutputBisectionGame is IOutputBisectionGame, Clone, ISemver { ...@@ -147,9 +147,11 @@ contract OutputBisectionGame is IOutputBisectionGame, Clone, ISemver {
// prestate. // prestate.
// If the step is an attack at a trace index > 0, the prestate exists elsewhere in // If the step is an attack at a trace index > 0, the prestate exists elsewhere in
// the game state. // the game state.
// WARN: This will not work, except for in the first execution trace bisection game! // NOTE: We localize the `indexAtDepth` for the current execution trace subgame by finding
// We need to replace `0` with the correct starting index for the given sub-game. // the remainder of the index at depth divided by 2 ** (MAX_GAME_DEPTH - SPLIT_DEPTH),
preStateClaim = stepPos.indexAtDepth() == 0 // which is the number of leaves in each execution trace subgame. This is so that we can
// determine whether or not the step position is represents the `ABSOLUTE_PRESTATE`.
preStateClaim = (stepPos.indexAtDepth() % (2 ** (MAX_GAME_DEPTH - SPLIT_DEPTH))) == 0
? ABSOLUTE_PRESTATE ? ABSOLUTE_PRESTATE
: findTraceAncestor(Position.wrap(Position.unwrap(parentPos) - 1), parent.parentIndex, false).claim; : findTraceAncestor(Position.wrap(Position.unwrap(parentPos) - 1), parent.parentIndex, false).claim;
// For all attacks, the poststate is the parent claim. // For all attacks, the poststate is the parent claim.
......
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