Commit 34ed8ff4 authored by clabby's avatar clabby Committed by GitHub

Use same `PreimageOracle` for alphabet VM and cannon VM (#9314)

parent 450c1446
This diff is collapsed.
......@@ -1076,7 +1076,7 @@ contract Deploy is Deployer {
_factory: factory,
_gameType: GameTypes.ALPHABET,
_absolutePrestate: outputAbsolutePrestate,
_faultVm: IBigStepper(new AlphabetVM(outputAbsolutePrestate)),
_faultVm: IBigStepper(new AlphabetVM(outputAbsolutePrestate, PreimageOracle(mustGetAddress("PreimageOracle")))),
// The max depth for the alphabet trace is always 3. Add 1 because split depth is fully inclusive.
_maxGameDepth: cfg.faultGameSplitDepth() + 3 + 1,
_allowUpgrade: _allowUpgrade
......
......@@ -49,7 +49,7 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
// Set the extra data for the game creation
extraData = abi.encode(l2BlockNumber);
AlphabetVM _vm = new AlphabetVM(absolutePrestate);
AlphabetVM _vm = new AlphabetVM(absolutePrestate, new PreimageOracle(0, 0, 0));
// Deploy an implementation of the fault game
gameImpl = new FaultDisputeGame({
......@@ -116,7 +116,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
/// @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 {
AlphabetVM alphabetVM = new AlphabetVM(absolutePrestate);
AlphabetVM alphabetVM = new AlphabetVM(absolutePrestate, new PreimageOracle(0, 0, 0));
// Test that the constructor reverts when the `_splitDepth` parameter is greater than or equal
// to the `MAX_GAME_DEPTH` parameter.
......
......@@ -12,9 +12,9 @@ contract AlphabetVM is IBigStepper {
Claim internal immutable ABSOLUTE_PRESTATE;
IPreimageOracle public oracle;
constructor(Claim _absolutePrestate) {
constructor(Claim _absolutePrestate, PreimageOracle _oracle) {
ABSOLUTE_PRESTATE = _absolutePrestate;
oracle = new PreimageOracle(0, 0, 0);
oracle = _oracle;
}
/// @inheritdoc IBigStepper
......
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