Skip to content

feat(nano): generalize faux-immutability#1349

Merged
glevco merged 2 commits intomasterfrom
feat/nano/faux-immutability
Aug 8, 2025
Merged

feat(nano): generalize faux-immutability#1349
glevco merged 2 commits intomasterfrom
feat/nano/faux-immutability

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Aug 6, 2025

Motivation

Generalize the immutability structures created for NanoRNG so it can be reused on other classes.

Acceptance Criteria

  • Implement FauxImmutable class, with a metaclass, that defines faux-immutability behavior for its subclasses.
  • Update NanoRNG to use FauxImmutable instead of its own ad-hoc solution. No behavior should change, except for:
    • Some error messages are changed.
    • You don't need NanoRNG.create_with_shell(), simply doing NanoRNG() will always provide a shell.

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 Aug 6, 2025
@glevco glevco moved this from Todo to In Progress (WIP) in Hathor Network Aug 6, 2025
@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 98.03922% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.71%. Comparing base (4b8dbc6) to head (339db24).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
hathor/nanocontracts/faux_immutable.py 97.61% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1349      +/-   ##
==========================================
+ Coverage   85.66%   85.71%   +0.04%     
==========================================
  Files         426      427       +1     
  Lines       32270    32304      +34     
  Branches     5025     5032       +7     
==========================================
+ Hits        27645    27690      +45     
+ Misses       3613     3602      -11     
  Partials     1012     1012              

☔ 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.

@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Aug 6, 2025
@glevco glevco force-pushed the refactor/nano/imports branch from caa70ac to 32b8694 Compare August 7, 2025 01:03
@glevco glevco force-pushed the feat/nano/faux-immutability branch from 91f8673 to bf782d6 Compare August 7, 2025 01:05
@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Aug 7, 2025
@glevco glevco force-pushed the refactor/nano/imports branch from 32b8694 to e880df3 Compare August 7, 2025 19:49
@glevco glevco force-pushed the feat/nano/faux-immutability branch 2 times, most recently from cffd4e5 to ab8a7ea Compare August 7, 2025 20:07
msbrogli
msbrogli previously approved these changes Aug 7, 2025
@glevco glevco force-pushed the refactor/nano/imports branch from e880df3 to aca527d Compare August 7, 2025 21:11
jansegre
jansegre previously approved these changes Aug 7, 2025
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Aug 7, 2025
@glevco glevco changed the base branch from refactor/nano/imports to master August 7, 2025 21:13
@glevco glevco dismissed stale reviews from jansegre and msbrogli August 7, 2025 21:13

The base branch was changed.

@glevco glevco force-pushed the feat/nano/faux-immutability branch from ab8a7ea to 339db24 Compare August 8, 2025 01:16
@github-actions
Copy link

github-actions bot commented Aug 8, 2025

🐰 Bencher Report

Branchfeat/nano/faux-immutability
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.70 m
(+3.68%)Baseline: 1.64 m
1.48 m
(86.80%)
1.81 m
(94.26%)
🐰 View full continuous benchmarking report in Bencher

@github-project-automation github-project-automation bot moved this from In Review (Done) to In Review (WIP) in Hathor Network Aug 8, 2025
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Aug 8, 2025
@glevco glevco merged commit a8366c2 into master Aug 8, 2025
8 checks passed
@glevco glevco deleted the feat/nano/faux-immutability branch August 8, 2025 14:48
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Aug 8, 2025
This was referenced Aug 12, 2025
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Aug 13, 2025
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