Skip to content

feat(nano): add support for json_dumps#1572

Merged
glevco merged 4 commits intomasterfrom
feat/nano/json-dumps
Jan 27, 2026
Merged

feat(nano): add support for json_dumps#1572
glevco merged 4 commits intomasterfrom
feat/nano/json-dumps

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Jan 23, 2026

Motivation

There's no easy way to call emit_event with json data in Blueprints. This PR adds support for json_dumps to fix this.

Acceptance Criteria

  • Add support for json_dumps in nano. The provided function supports a subset of arguments of Python's json.dumps.
  • This can be merged without Feature Activation as long as we wait to the FEE_TOKENS feature to become active, before approving OCBs that use json_dumps.
  • Assert that data passed to emit_event is bytes.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Jan 23, 2026
@glevco glevco moved this from Todo to In Progress (Done) in Hathor Network Jan 23, 2026
@glevco glevco force-pushed the feat/nano/json-dumps branch from 3558fe8 to 66ff723 Compare January 23, 2026 16:16
@github-actions
Copy link

github-actions bot commented Jan 23, 2026

🐰 Bencher Report

Branchfeat/nano/json-dumps
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.68 m
(-2.24%)Baseline: 1.72 m
1.54 m
(92.06%)
2.06 m
(81.47%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.26%. Comparing base (ccfe8c6) to head (63509d6).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
hathor/nanocontracts/nc_exec_logs.py 0.00% 1 Missing and 1 partial ⚠️
hathor/nanocontracts/utils.py 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1572      +/-   ##
==========================================
- Coverage   86.34%   86.26%   -0.09%     
==========================================
  Files         439      439              
  Lines       33690    33699       +9     
  Branches     5271     5273       +2     
==========================================
- Hits        29091    29070      -21     
- Misses       3596     3618      +22     
- Partials     1003     1011       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

msbrogli
msbrogli previously approved these changes Jan 23, 2026
@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Jan 23, 2026
msbrogli
msbrogli previously approved these changes Jan 23, 2026
@glevco glevco force-pushed the feat/nano/json-dumps branch from 143a655 to 63509d6 Compare January 27, 2026 12:39
@glevco glevco merged commit b150e70 into master Jan 27, 2026
18 of 22 checks passed
@glevco glevco deleted the feat/nano/json-dumps branch January 27, 2026 15:15
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Jan 27, 2026
@jansegre jansegre mentioned this pull request Jan 28, 2026
2 tasks
r4mmer added a commit that referenced this pull request Jan 29, 2026
* origin/master:
  chore: configure feature activations for v0.69.0 release
  refactor: wallet on_new_tx (#1561)
  refactor(nano): Remove dead reorg cleanup code from block executor
  feat(script): deprecate unnecessary opcodes
  test: Fix flaky tests
  refactor(nano): Refactor to facilitate dry runnning blocks and transactions
  feat(nano): add support for json_dumps (#1572)
  refactor(nano): Move the nano execution logic to a separate file
@jansegre jansegre mentioned this pull request Jan 30, 2026
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants