Skip to content

chore(dashmate): update tenderdash up to 0.10.0-dev.6#674

Merged
shuplenkov merged 3 commits into
v0.24-devfrom
update_tenderdash
Dec 19, 2022
Merged

chore(dashmate): update tenderdash up to 0.10.0-dev.6#674
shuplenkov merged 3 commits into
v0.24-devfrom
update_tenderdash

Conversation

@shuplenkov
Copy link
Copy Markdown

@shuplenkov shuplenkov commented Dec 16, 2022

Issue being fixed or feature implemented

Need to update TenderDash up to the latest version

What was done?

TenderDash was updated up to 0.10.0-dev.6

How Has This Been Tested?

With tests

Breaking Changes

No

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

@shuplenkov shuplenkov added this to the v0.24.0 milestone Dec 16, 2022
Copy link
Copy Markdown
Collaborator

@shumkov shumkov left a comment

Choose a reason for hiding this comment

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

👍

@shuplenkov shuplenkov merged commit 77cd27e into v0.24-dev Dec 19, 2022
@shuplenkov shuplenkov deleted the update_tenderdash branch December 19, 2022 07:49
QuantumExplorer added a commit that referenced this pull request May 19, 2026
Bumps grovedb pin to #674 head
`49e17ce47744915878fcf1ef49de916e9d3ddde3` and wires the new
`EstimatedLayerSizes::AllItemsWithSumItem` /
`AllReferencesWithSumItem` variants + the four
`provable_*_trees_weight` fields on `EstimatedSumTrees::SomeSumTrees`
through dash-platform's estimation paths.

## Address-funds estimation (v0/v1 split — consensus-safe)

`for_address_balance_update` now dispatches on
`drive_version.methods.address_funds.cost_estimation.for_address_balance_update`:

- **v0** (unchanged, locked to protocol v11 production): uses
  `EstimatedLayerSizes::AllItems(...)` for the CLEAR_ADDRESS_POOL
  leaf layer. Undercharges by ~10 bytes per insert (the i64 sum_value
  on `ItemWithSumItem` isn't accounted for), but the undercharge is
  consensus-locked.
- **v1** (active at protocol v12+): switches the leaf layer to
  `AllItemsWithSumItem(...)` so dry-run fees match applied fees.

Method-version table: new `DRIVE_ADDRESS_FUNDS_METHOD_VERSIONS_V2`
bumps `for_address_balance_update: 0 → 1`. Wired into
`DRIVE_VERSION_V7` (protocol v12). V1 table (`for_address_balance_update: 0`)
stays selected for v11 (`DRIVE_VERSION_V6`).

## Contract-insertion estimation refactor (v12-only, no consensus risk)

`add_estimation_costs_for_contract_insertion_v1` previously tallied
all count-bearing children (CountTree + ProvableCountTree) into a
single `count_trees_weight`. With grovedb #674's finer-grained
weights, the loop now:

- Categorizes each doctype-children tree via
  `property_name_tree_type_from_flags` (a 9-way matrix matching the
  selection in `add_indices_for_index_level_for_contract_operations`).
- Tallies into a `TreeTypeWeights` struct keyed by every TreeType
  variant the contract apply path can write.
- Maps the tally to `SomeSumTrees` with the right weight per slot —
  including `provable_sum_trees_weight`,
  `provable_count_sum_trees_weight`, and
  `provable_count_provable_sum_trees_weight` for the v12 sum-tree
  feature's `range_summable` / `range_summable + range_countable`
  indexes.

Existing test
`range_countable_index_contract_counts_both_pk_and_index_as_count_children`
updated to reflect the new split: CountTree primary-key counts as
`count_trees_weight: 1`, ProvableCountTree index counts as
`provable_count_trees_weight: 1` (was previously both lumped into
`count_trees_weight: 2`).

## Per-element estimation already wired

The three v12-only doc-storage sites continue to use the per-element
sum-aware helpers from grovedb #673 (
`required_item_with_sum_item_space` /
`required_reference_with_sum_item_space`) added in the previous
commit.

## Snapshot updates

Two v12 fee snapshots updated for the +99_260 processing-fee shift
that grovedb #674's new cost formula introduces:
- `identity::balance::update::should_add_to_balance_latest_version_estimated`:
  4_278_840 → 4_378_100. v1 variant (`should_add_to_balance_first_version_estimated`)
  still pins 4_278_840 — grovedb #674's v0/v1 formulas are byte-stable.
- `tokens::balance::update::should_estimate_costs_without_state`:
  same delta, same explanation.

## Struct-field plumbing

All 25 construction sites of `EstimatedSumTrees::SomeSumTrees` and
`EstimatedLayerSizes::Mix` in rs-drive updated to fill the new
fields with `0` / `None` respectively (preserving today's behavior
since no caller has data to populate them yet).

drive 3165/3165, dpp 3461/3467 (6 ignored), drive-abci 2466/2475 (9
ignored). clippy `--workspace --all-features -D warnings` clean.
QuantumExplorer added a commit that referenced this pull request May 19, 2026
Bumps grovedb pin from #674's PR-branch SHA
`49e17ce47744915878fcf1ef49de916e9d3ddde3` → develop head
`ad2492dcdc869a1452b0b10fbed8f9b0de1634c6` which is the merged form
plus the follow-up Mix-arm fixes CodeRabbit caught during review:

- `value_with_feature_and_flags_size` Mix arm: pre-existing bug
  where mixed layers averaged `Σ size_i / Σ weight_i` instead of the
  proper weighted `Σ (size_i · weight_i) / Σ weight_i`. New v1
  formula at grove v3+ (v0/v1 stay byte-stable for v11/v12 consensus
  baseline).
- `add_average_case_merk_propagate` Mix arms: pre-existing
  `cost / nodes_updated²` underestimate. New v2 formula at grove v3+
  matches the homogeneous `AllItems` / `AllSubtrees` arms; v1 stays
  byte-stable for grove v2 (platform v12 production cost basis).
- Macro hygiene fix on `check_grovedb_v0_v1_or_v2!` and a v0 divisor
  guard for `EstimatedSumTrees::estimated_size`.
- Refactor: per-function dispatchers split into per-version files
  (dash-platform-style layout). No behavior change.

drive 3165/3165, dpp 3461/3467 (6 ignored). clippy clean. No
additional dash-platform fee snapshot shifts — the Mix arms aren't
hit by the identity / token balance estimation paths the previous
commit pinned.
QuantumExplorer added a commit that referenced this pull request May 19, 2026
- Remove stale stub-status comments in DriveVerifyDocumentSumMethodVersions
  and DriveGroveBatchMethodVersions
- Import DocumentPropertyType in try_from_schema/v2 so the summable
  allow-list match arms aren't fully qualified
- Revert v0 of remove_indices_for_index_level_for_contract_operations to
  v3.1-dev (consensus stability: v0 is stuck in time and only ever runs
  on NormalTree parents)
- Rename LowLevelDriveOperation::for_known_path_key_empty_tree_under_aggregating_parent
  to wrap_in_non_aggregated_for_parent_tree_type for clarity
- Add dedicated batch_insert_empty_count_sum_tree helper (paralleling
  batch_insert_empty_sum_tree etc.) and switch insert_contract_v0 to it
- Lift TreeTypeWeights + property_name_tree_type_from_flags from
  add_estimation_costs_for_contract_insertion/v1 up to
  contract/estimation_costs so future estimation surfaces can reuse them
- Add should_estimate_costs_without_state_in_v11 pinning the v11
  processing fee at 4_278_840 (the pre-grovedb-#674 baseline; the v12
  successor pins 4_378_100)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants