What changed, and why it matters
This commit changes a developer-only simulator script so that when the '--eff' flag is used, settings are kept in memory during a single run instead of being completely disabled. Previously the flag made all settings loading and saving do nothing, which meant pre-login values were lost while the simulator was running. The change makes the simulator behave more realistically for testing. It does not affect real COLDCARD hardware or production firmware.
No security action required. Treat as normal development/maintenance commit. Reviewers may optionally verify that the in-memory NVSTORE_FAKE dictionary is not accidentally shared across simulator invocations or accessible outside the simulator process, but this is not a product security concern.
Security signals we found
No security-relevant signal: change is confined to simulator boot script
No cryptographic, authentication, or storage code modified
No privilege boundary crossed
No input parsing or network code modified
Evidence from the diff
In unix/sim_boot.py, the ‘–eff’ (emulated flash filesystem) flag handling is updated. The old code replaced SettingsObject.load and .save with no-op lambdas, which discarded settings changes during a simulator run. The new code installs monkey-patched load/save methods that store settings in an in-memory dictionary keyed by nvram_key, preserving pre-login values and any changes made during the current run. This is purely a simulator/testing quality-of-life improvement and does not touch the on-device nvstore implementation or real flash storage.
Changed components
unix/sim_boot.pyCOLDCARD firmware simulator / development tooling onlyInspect captured patch +9 / −4
diff --git a/unix/sim_boot.py b/unix/sim_boot.py
index ef6efb4..a86e198 100644
--- a/unix/sim_boot.py
+++ b/unix/sim_boot.py
@@ -29,11 +29,16 @@ if '--sflash' not in sys.argv:
if '--eff' in sys.argv:
# ignore files ondisk from previous runs, and also dont write any
- nvstore.SettingsObject.load = lambda *a:None
- nvstore.SettingsObject.save = lambda *a:None
- # limitation: pre-login values arent stored even during operation
+ # - but do track settings during this run
+ NVSTORE_FAKE = {bytes(32): dict(sim_defaults)} # prelogin values
- #glob.settings.current = dict(sim_defaults)
+ def _monkey_load(self, *a):
+ self.current = dict(NVSTORE_FAKE.get(self.nvram_key, {}))
+ def _monkey_save(self, *a):
+ NVSTORE_FAKE[self.nvram_key] = dict(self.current)
+
+ nvstore.SettingsObject.load = _monkey_load
+ nvstore.SettingsObject.save = _monkey_save
if '--early-usb' in sys.argv:
from usb import enable_usb
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.