Fix/nonce migration and consensus#38
Open
i-naman wants to merge 10 commits into
Open
Conversation
…etch - Created standalone Scripts/replay_blocks_and_export.go for computing TxCount - Created standalone Scripts/patch_accounts.go for updating Nonces and standardizing timestamps - Replaced CheckNonceAndGetLatest in Security.go with O(1) GetAccount verification - Fixed new account generation in DB_OPs to initialize Nonce to 0 natively - Hardened DID registration to enforce UnixNano() timestamps
…couple TxCountSent - schema: added TxCountSent to Account schema to decouple analytical stats from cryptographic Nonce - db: added UpdateAccountSenderState to handle atomic balance and state updates - core: injected execution-time strict nonce validation (tx.Nonce < didDoc.Nonce) in deductFromSender to eliminate same-block double-execution loophole - core: fixed severe bug where sequencer failed to persist Nonce updates to DB after block execution - scripts: created patch_accounts_v2.go to safely migrate accountsdb by mapping TxCount -> TxCountSent and MaxNonce+1 -> Nonce
Moved Redis consumer group initialization into an asynchronous retry loop inside runWorker. The node now boots successfully even if Redis is completely offline, gracefully degrading bulk sync operations while preserving live transaction processing. Retry interval set to 30s to minimize log spam.
…eID generation
- Reverted Account options and restored pure 'GenerateStateID()' for locally originated accounts.
- Removed hacky deterministic 'StateID' origination from 'BlockProcessing'. Consensus now strictly requires accounts to exist before transacting.
- Added pre-flight hook in 'eth_getBalance' facade to natively originate and gossip missing accounts via P2P before consensus.
- Updated 'Account' adapter mappings to cross-wire Fastsync 'types.Account' safely ('StateID' -> 'Nonce', 'Nonce' -> 'TxNonce').
- Secured incoming P2P DID Gossips using 'StorePropagatedAccount' to perfectly preserve network StateIDs.
…ration-and-consensus # Conflicts: # DB_OPs/Nodeinfo/account_sync_worker.go
… and adding TxNonce
… replays - Security module now exclusively uses SecurityCache for TxNonce resolution, drastically reducing DB I/O during batch validation. - Cache enforces mutation upon successful verification (UpdateTxNonce), mitigating intra-block replay attack vectors. - Renamed cache methods to strictly differentiate between Ethereum TxNonce and Fastsync Nonce (StateID). - Fixed static off-by-one error (MaxNonce vs MaxNonce + 1) in V3 migration script.
…ration-and-consensus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Why
How
Testing
Checklist
make buildpassesmake lintpassesmake fmt-checkpasses