From b09721c937d8c232bf89a89de94a78303605a48e Mon Sep 17 00:00:00 2001 From: Raoul Date: Thu, 23 Jul 2026 10:19:41 +0000 Subject: [PATCH 1/2] chore(deps): bump komet to v0.1.86 --- pyproject.toml | 2 +- uv.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 89629f3..c93e34d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ readme = "README.md" requires-python = "~=3.10" dependencies = [ "stellar-sdk>=13.2.1", - "komet@git+https://github.com/runtimeverification/komet.git@v0.1.85", + "komet@git+https://github.com/runtimeverification/komet.git@v0.1.86", "kframework>=7.1.323,<7.1.324", ] diff --git a/uv.lock b/uv.lock index 672acba..8b41a20 100644 --- a/uv.lock +++ b/uv.lock @@ -730,7 +730,7 @@ wheels = [ [[package]] name = "komet" version = "0.1.84" -source = { git = "https://github.com/runtimeverification/komet.git?rev=v0.1.85#089b3aa59bcb685764a4579f7077ca1c2add8168" } +source = { git = "https://github.com/runtimeverification/komet.git?rev=v0.1.86#e898e5b252abce6f02e3cb0341525fd09d95737b" } dependencies = [ { name = "pykwasm" }, { name = "tomli" }, @@ -770,7 +770,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "kframework", specifier = ">=7.1.323,<7.1.324" }, - { name = "komet", git = "https://github.com/runtimeverification/komet.git?rev=v0.1.85" }, + { name = "komet", git = "https://github.com/runtimeverification/komet.git?rev=v0.1.86" }, { name = "stellar-sdk", specifier = ">=13.2.1" }, ] From 826fcfb5bc941eba730360d91f591347463d57b4 Mon Sep 17 00:00:00 2001 From: Raoul Date: Thu, 23 Jul 2026 10:35:14 +0000 Subject: [PATCH 2/2] test: account for new mem field in instruction trace records komet v0.1.86 adds a per-instruction linear-memory snapshot (mem) to trace records: a list of {addr, bytes} runs when memory changed since the previous record, null otherwise. Update the trace fixtures, the record-shape assertion, and the README trace reference accordingly. --- README.md | 12 ++++++------ src/tests/integration/test_server.py | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2224abb..9dea199 100644 --- a/README.md +++ b/README.md @@ -136,11 +136,11 @@ curl -s http://localhost:8000 -H 'Content-Type: application/json' \ "to": {"type": "address", "addrType": "contract", "value": "6a20fec1a9081773a5f23ce370f925f236346e510438ddd6d40f6b2711c134e0"}, "function": "foo", "args":[], "depth":1, "storage":[] }, - {"pos": 3, "instr": ["const", "i32", 1048576], "stack": [], "locals": {}}, - {"pos": 11, "instr": ["const", "i32", 1048576], "stack": [], "locals": {}}, - {"pos": 19, "instr": ["const", "i32", 1048576], "stack": [], "locals": {}}, - {"pos": null, "instr": ["block"], "stack": [], "locals": {}}, - {"pos": 3, "instr": ["const", "i64", 2], "stack": [], "locals": {}}, + {"pos": 3, "instr": ["const", "i32", 1048576], "stack": [], "locals": {}, "mem": null}, + {"pos": 11, "instr": ["const", "i32", 1048576], "stack": [], "locals": {}, "mem": null}, + {"pos": 19, "instr": ["const", "i32", 1048576], "stack": [], "locals": {}, "mem": null}, + {"pos": null, "instr": ["block"], "stack": [], "locals": {}, "mem": null}, + {"pos": 3, "instr": ["const", "i64", 2], "stack": [], "locals": {}, "mem": null}, {"pos": null, "instr": ["endWasm"], "success":true, "depth":1, "result": {"type": "void"}} ] } @@ -159,7 +159,7 @@ The example above only has three of these: `callContract`, instruction records, Here's what each record type carries: - `callContract`: logged for each contract call in the transaction, including contract-to-contract calls. Records the caller, the callee, the function name, the arguments, the call depth, and the callee's storage before the call runs. -- Instruction records: logged at each WebAssembly instruction's entry. `pos` is the instruction's byte offset in the binary (`null` for synthetic instructions), `instr` is the instruction and its operands, and `stack`/`locals` are the value stack and locals as `[type, value]` pairs. +- Instruction records: logged at each WebAssembly instruction's entry. `pos` is the instruction's byte offset in the binary (`null` for synthetic instructions), `instr` is the instruction and its operands, and `stack`/`locals` are the value stack and locals as `[type, value]` pairs. `mem` is a snapshot of linear memory as a list of `{addr, bytes}` runs, emitted only when memory changed since the previous record and `null` otherwise (reuse the most recent snapshot). - `hostCall`: logged when the contract calls a host function. `instr` gives `["hostCall", moduleId, functionId]`, identifying which host function ran. `locals` holds the function's arguments, indexed by position. Host calls don't use the stack, so `stack` is absent. Here's a `hostCall` record for a call to `put_contract_data`, module id `l`, function id `_`: ```jsonc diff --git a/src/tests/integration/test_server.py b/src/tests/integration/test_server.py index bced437..783c7ac 100644 --- a/src/tests/integration/test_server.py +++ b/src/tests/integration/test_server.py @@ -503,11 +503,11 @@ def test_trace_transaction_returns_full_instruction_trace_for_foo(server: Stella # The executed WebAssembly instructions, exactly as shown in the README. assert trace[1:-1] == [ - {'pos': 3, 'instr': ['const', 'i32', 1048576], 'stack': [], 'locals': {}}, - {'pos': 11, 'instr': ['const', 'i32', 1048576], 'stack': [], 'locals': {}}, - {'pos': 19, 'instr': ['const', 'i32', 1048576], 'stack': [], 'locals': {}}, - {'pos': None, 'instr': ['block'], 'stack': [], 'locals': {}}, - {'pos': 3, 'instr': ['const', 'i64', 2], 'stack': [], 'locals': {}}, + {'pos': 3, 'instr': ['const', 'i32', 1048576], 'stack': [], 'locals': {}, 'mem': None}, + {'pos': 11, 'instr': ['const', 'i32', 1048576], 'stack': [], 'locals': {}, 'mem': None}, + {'pos': 19, 'instr': ['const', 'i32', 1048576], 'stack': [], 'locals': {}, 'mem': None}, + {'pos': None, 'instr': ['block'], 'stack': [], 'locals': {}, 'mem': None}, + {'pos': 3, 'instr': ['const', 'i64', 2], 'stack': [], 'locals': {}, 'mem': None}, ] # An endWasm exit frame closes the trace: the call succeeded and returned Void. @@ -555,8 +555,10 @@ def test_trace_records_have_expected_structure_and_reflect_arguments(server: Ste instr_records = [record for record in trace if 'locals' in record] assert instr_records for record in instr_records: - assert set(record) == {'pos', 'instr', 'stack', 'locals'} + assert set(record) == {'pos', 'instr', 'stack', 'locals', 'mem'} assert record['pos'] is None or isinstance(record['pos'], int) + # mem is null when linear memory is unchanged since the previous record, else a list of runs. + assert record['mem'] is None or isinstance(record['mem'], list) assert isinstance(record['instr'], list) and record['instr'] assert isinstance(record['instr'][0], str) # opcode mnemonic # stack and locals hold [type, value] pairs.