Skip to content

fix(wasm-dpp): fix decoding protocol version varint error to match previous implementation - #849

Merged
markin-io merged 3 commits into
v0.24-devfrom
fix-protocol-error
Mar 23, 2023
Merged

markin-io merged 3 commits into
v0.24-devfrom
fix-protocol-error

Conversation

@antouhou

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

CI being broken because varint parsing error implementation changed

What was done?

Brought the old error back

How Has This Been Tested?

Run the tests

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@antouhou
antouhou requested a review from shumkov as a code owner March 23, 2023 04:21

@shumkov shumkov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@markin-io
markin-io merged commit 8041647 into v0.24-dev Mar 23, 2023
@markin-io
markin-io deleted the fix-protocol-error branch March 23, 2023 09:24
QuantumExplorer added a commit that referenced this pull request Sep 1, 2026
…, budgeted deepest-first, full-path removal granularity

Replaces the recursive-delete placeholder with the primitive that landed
for dashpay/grovedb#848 (grovedb PR #849): the flat-subtree drop — O(1)
consensus removal of a subtree declared to hold no child subtrees, with
a durable redo record staged atomically (outside the root hash) naming
every orphaned storage prefix (the subtree's own plus, for indexed
primaries, the three per-axis secondaries), reclaimed outside consensus
via range tombstones. Pin bumped to the PR head.

A time-range bucket is not flat, so drainage works DEEPEST-FIRST, one
flat unit at a time: each group's [0] reference tree (where the mass
lives) is flat-dropped; the emptied group value tree leaves through the
flat drop — or, under a ranked property-name tree, through grovedb's
dedicated indexed-tree delete, which mirrors the group out of the
ranking secondary (grovedb rejects generic child removals from indexed
primaries, on the immediate path too); the drained property-name tree is
flat-dropped, dooming its secondary prefixes; the emptied bucket last.
Every step is O(1) — the step COUNT is what scales with the window's
distinct groups, and that count is the budget.

The trigger broadens from bucket-creating writes to EVERY write into a
TTL'd index: one bucket-creation per step could never drain a window
whose group count exceeds a single budget. Each write resumes exactly
where the previous budget ran out (the drain is stateless — it re-finds
the oldest expired bucket and its first remaining group); when nothing
is expired the check is one bounded range read. The SystemLimits cap is
renamed accordingly (max_time_range_ttl_drop_operations_per_write, 8).

Partial drainage forces the removal walkers from bucket granularity to
FULL-PATH granularity: a delete (or key-changing update) of a document
whose group trees the drain already took inside a still-standing bucket
skips exactly that entry (walked existence checks from the document-type
path, so a missing intermediate answers false instead of erroring),
while a document whose trees still stand is removed normally — an
undrained expired bucket never carries dangling references. The skip
flag threads through the delete recursion and is set only on the
stateful path for expired-and-standing buckets; live buckets behave
byte-identically to before.

Host duties land in drive-abci: flush_pending_prefix_drops after each
finalized block's commit (the drops' redo records become visible there)
and once at platform open, completing reclamation a crash interrupted.
Both are outside consensus — failures log and retry, the root hash is
never involved.

New coverage: the partial-drain e2e pins the resume behavior (five
groups exceed one budget; groups drain in key order; deletes from both
drained and standing groups succeed mid-state; a later write finishes
the bucket), alongside the adapted lifecycle e2e now running against
the real primitive. Design doc updated to the shipped shape.

Co-Authored-By: Claude Fable 5 <[email protected]>
QuantumExplorer added a commit that referenced this pull request Sep 1, 2026
Moves the pin from grovedb PR #849's head to the develop merge commit,
so it no longer references a deletable PR branch. No code changes; the
TTL drainage, ranked, and time-range batteries all pass on the merged
rev.

Co-Authored-By: Claude Fable 5 <[email protected]>
QuantumExplorer added a commit that referenced this pull request Sep 1, 2026
…, budgeted deepest-first, full-path removal granularity

Replaces the recursive-delete placeholder with the primitive that landed
for dashpay/grovedb#848 (grovedb PR #849): the flat-subtree drop — O(1)
consensus removal of a subtree declared to hold no child subtrees, with
a durable redo record staged atomically (outside the root hash) naming
every orphaned storage prefix (the subtree's own plus, for indexed
primaries, the three per-axis secondaries), reclaimed outside consensus
via range tombstones. Pin bumped to the PR head.

A time-range bucket is not flat, so drainage works DEEPEST-FIRST, one
flat unit at a time: each group's [0] reference tree (where the mass
lives) is flat-dropped; the emptied group value tree leaves through the
flat drop — or, under a ranked property-name tree, through grovedb's
dedicated indexed-tree delete, which mirrors the group out of the
ranking secondary (grovedb rejects generic child removals from indexed
primaries, on the immediate path too); the drained property-name tree is
flat-dropped, dooming its secondary prefixes; the emptied bucket last.
Every step is O(1) — the step COUNT is what scales with the window's
distinct groups, and that count is the budget.

The trigger broadens from bucket-creating writes to EVERY write into a
TTL'd index: one bucket-creation per step could never drain a window
whose group count exceeds a single budget. Each write resumes exactly
where the previous budget ran out (the drain is stateless — it re-finds
the oldest expired bucket and its first remaining group); when nothing
is expired the check is one bounded range read. The SystemLimits cap is
renamed accordingly (max_time_range_ttl_drop_operations_per_write, 8).

Partial drainage forces the removal walkers from bucket granularity to
FULL-PATH granularity: a delete (or key-changing update) of a document
whose group trees the drain already took inside a still-standing bucket
skips exactly that entry (walked existence checks from the document-type
path, so a missing intermediate answers false instead of erroring),
while a document whose trees still stand is removed normally — an
undrained expired bucket never carries dangling references. The skip
flag threads through the delete recursion and is set only on the
stateful path for expired-and-standing buckets; live buckets behave
byte-identically to before.

Host duties land in drive-abci: flush_pending_prefix_drops after each
finalized block's commit (the drops' redo records become visible there)
and once at platform open, completing reclamation a crash interrupted.
Both are outside consensus — failures log and retry, the root hash is
never involved.

New coverage: the partial-drain e2e pins the resume behavior (five
groups exceed one budget; groups drain in key order; deletes from both
drained and standing groups succeed mid-state; a later write finishes
the bucket), alongside the adapted lifecycle e2e now running against
the real primitive. Design doc updated to the shipped shape.

Co-Authored-By: Claude Fable 5 <[email protected]>
QuantumExplorer added a commit that referenced this pull request Sep 1, 2026
Moves the pin from grovedb PR #849's head to the develop merge commit,
so it no longer references a deletable PR branch. No code changes; the
TTL drainage, ranked, and time-range batteries all pass on the merged
rev.

Co-Authored-By: Claude Fable 5 <[email protected]>
QuantumExplorer added a commit that referenced this pull request Sep 4, 2026
…a shared key, #850)

Pins grovedb at dashpay/grovedb#850: `PathQuery::merge` (v1) now
descends into a key another grafted branch already owns and grafts a
limited branch where the two actually diverge, instead of refusing the
collision at the first key past the common path; a lone body landing at
a merged root keeps the caps on its own branches. Composite document
queries (a page plus derived sub-queries under one merged proof) need
this: a limited page on `post` merged with a by-id fetch on `post`, or a
limited page and a limited lookup under one contract once a
cross-contract sub-query lifts the common path to the root, all collide
one level above where they diverge. Also carries #849 (flat-subtree
drop) from develop. No API change on the platform side.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
QuantumExplorer added a commit that referenced this pull request Sep 4, 2026
…a shared key, #850)

Pins grovedb at dashpay/grovedb#850: `PathQuery::merge` (v1) now
descends into a key another grafted branch already owns and grafts a
limited branch where the two actually diverge, instead of refusing the
collision at the first key past the common path; a lone body landing at
a merged root keeps the caps on its own branches. Composite document
queries (a page plus derived sub-queries under one merged proof) need
this: a limited page on `post` merged with a by-id fetch on `post`, or a
limited page and a limited lookup under one contract once a
cross-contract sub-query lifts the common path to the root, all collide
one level above where they diverge. Also carries #849 (flat-subtree
drop) from develop. No API change on the platform side.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.

4 participants