Re-confirm unchanged stake, and never submit a partial total (#33)

People Chain now counts a staking duration only up to the last confirmation
of the stake plus MaxDataAge (fourteen days), so a stopped noter cannot leave
scores climbing on unchecked data. The bot submitted only on change, which
under that rule would freeze every account whose stake stays put.

confirm.js decides when unchanged stake is sent again: not while a
submission is pending (each one restarts the dispute window), not on
half-read data, and only once the last confirmation is CONFIRM_EVERY_BLOCKS
old (default three days). On a runtime without stakingScore.lastConfirmed
the bot behaves as before.

The direct-staking query failed silently into zeros, and a zero that lands
clears the account's stake clock on chain. It now reports the failure, and a
failure in either half skips the account for that scan.
This commit is contained in:
SatoshiQaziMuhammed authored and GitHub committed 2026-10-18 21:59:02 +04:00
1 parent e3ba45f449
commit 0220302a98
5 files changed
+133 -8

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ jobs:
# Run inside the image, so the modules under test are the ones the image ships.
- name: Unit tests
if: matrix.bot == 'noter'
run: docker run --rm -v "$PWD/noter/test:/app/test:ro" bot node --test test/submit.test.mjs
run: docker run --rm -v "$PWD/noter/test:/app/test:ro" bot node --test test/submit.test.mjs test/confirm.test.mjs
- name: The bot loads and stops at its missing mnemonic
env: