Skip to content

Hive#4

Merged
tkstanczak merged 4 commits into
masterfrom
hive
Feb 28, 2018
Merged

Hive#4
tkstanczak merged 4 commits into
masterfrom
hive

Conversation

@tkstanczak

Copy link
Copy Markdown
Member

No description provided.

@tkstanczak tkstanczak merged commit 6b09feb into master Feb 28, 2018
@tkstanczak tkstanczak deleted the hive branch March 16, 2018 22:52
@claude claude Bot mentioned this pull request Apr 29, 2026
12 tasks
@LukaszRozmej LukaszRozmej mentioned this pull request May 7, 2026
6 tasks
@LukaszRozmej LukaszRozmej mentioned this pull request May 18, 2026
16 tasks
This was referenced May 22, 2026
kamilchodola added a commit that referenced this pull request May 28, 2026
#3+#4 (correctness/robustness): the sparse-vs-Patricia agreement counter lived
in static fields on FlatWorldStateScope. Every scope (read-only RPC, parallel
block processing, snapshot validation) updated and read the same counter, so
one scope's mismatch could reset another's confidence and one scope's wins
could promote another to authoritative without that scope validating its own
sparse trie. Moved to SparseAuthoritativeTracker held by FlatScopeProvider so
each provider owns its own confidence.

Also tied _sparseIsAuthoritative to SparseTrieSkipPatricia: the previous
condition (just 10 consecutive matches and !VerificationMode) flipped sparse
into the authoritative root/commit role while Patricia BulkSet still ran on
every block, paying for trie work whose result was thrown away. Now sparse
takes over only when the operator has explicitly opted out of Patricia
persistence via SparseTrieSkipPatricia (currently default-on for the EXPB
sparse-storage runs).

#5 (performance): storage commit walked every retained sparse storage trie
on every block. With cross-block PreservedSparseTrie reuse and no LFU pruning
yet, that's O(retained contracts) per commit and grows unboundedly. Expose
DirtyStorageAccountHashes (a lock-free enumeration of SparseRootComputer's
_storageChanges keys) and walk only the contracts whose storage actually
changed this block. CommitStorageTrie still skips clean subtrees internally
as a second filter, but now we don't even iterate cold contracts at the outer
level.

Test updates: FlatWorldStateScopeProviderTests registers SparseAuthoritativeTracker
in the Autofac container; FlatOverridableWorldScope and WriteBatchBenchmark
pass new instances at construction. All 432 State.Flat tests pass.
@claude claude Bot mentioned this pull request Jun 2, 2026
12 tasks
Marchhill added a commit that referenced this pull request Jun 10, 2026
ArrayPoolList<Transaction> for the reservoir — Count tracks actual non-blob
fill, so the prior alloc + Array.Resize + copy pair when the mempool yielded
fewer than capacity non-blob txs is gone. Buffer is rented from the shared
ArrayPool and disposed via the using in GetInclusionList.

Addresses Lukasz's #4 round-5 comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant