Skip to content

Commit c41b553

Browse files
committed
fixup! feat(emulator): bump emulator (v0.21.0) and rootfs (v0.18.0). make it build
1 parent 7b03695 commit c41b553

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

cmd/cartesi-rollups-machine-tool/replay_dave.lua

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
local cartesi = require("cartesi")
55

6-
local checkpoint_address = 0xfe0
7-
86
local function usage(message)
97
if message then io.stderr:write(message, "\n") end
108
io.stderr:write(
@@ -74,17 +72,16 @@ local function ensure_manual_yield(machine)
7472
end
7573

7674
local function advance_one(machine, input_path, input_number)
77-
local checkpoint = machine:get_root_hash()
78-
machine:write_memory(checkpoint_address, checkpoint)
79-
machine:send_cmio_response(cartesi.CMIO_YIELD_REASON_ADVANCE_STATE, read_all(input_path))
75+
local revert_root_hash = machine:get_root_hash()
76+
machine:send_cmio_response(revert_root_hash, cartesi.HTIF_YIELD_REASON_ADVANCE_STATE, read_all(input_path))
8077
run_until_manual_yield(machine)
8178

8279
local _, reason, data = machine:receive_cmio_request()
83-
if reason == cartesi.CMIO_YIELD_MANUAL_REASON_RX_REJECTED then
80+
if reason == cartesi.HTIF_YIELD_MANUAL_REASON_RX_REJECTED then
8481
error(string.format("Dave replay input %d was rejected", input_number))
85-
elseif reason == cartesi.CMIO_YIELD_MANUAL_REASON_TX_EXCEPTION then
82+
elseif reason == cartesi.HTIF_YIELD_MANUAL_REASON_TX_EXCEPTION then
8683
error(string.format("Dave replay input %d raised an exception", input_number))
87-
elseif reason ~= cartesi.CMIO_YIELD_MANUAL_REASON_RX_ACCEPTED then
84+
elseif reason ~= cartesi.HTIF_YIELD_MANUAL_REASON_RX_ACCEPTED then
8885
error(string.format("Dave replay input %d ended with unexpected yield reason %s", input_number, tostring(reason)))
8986
end
9087
if #data ~= 32 then

test/integration/withdrawal_lifecycle_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"strings"
2121
"testing"
2222
"time"
23+
"encoding/base64"
2324

2425
"github.com/cartesi/rollups-node/internal/config"
2526
"github.com/cartesi/rollups-node/internal/jsonrpc/api"
@@ -581,7 +582,9 @@ func (s *WithdrawalLifecycleSuite) generateWithdrawalProofs(
581582
MachineRoot string `json:"machine_root"`
582583
}
583584
r.NoError(json.Unmarshal([]byte(replayOut), &replaySummary), "parse machine replay summary")
584-
r.Equal(strings.ToLower(finalEpoch.MachineHash.Hex()), strings.ToLower(replaySummary.MachineRoot),
585+
rawMachineRoot, err := base64.StdEncoding.DecodeString(replaySummary.MachineRoot)
586+
r.NoError(err)
587+
r.Equal(finalEpoch.MachineHash, rawMachineRoot,
585588
"replayed machine root must match finalized epoch machine hash")
586589

587590
driveProofPath := filepath.Join(tmp, "drive-root-proof.json")

0 commit comments

Comments
 (0)