Skip to content

Conversation

@severin-amrein
Copy link
Contributor

@severin-amrein severin-amrein commented Dec 16, 2025

Backwards compatibility:

# still supported for backwards compatibility -> it calls 'dre registry get' under the hood
dre registry

# not supported anymore
dre registry --height <>
dre registry --dump-versions <>

Introduction of three new subcommands:

Get: Show aggregated registry data

# output
{
  "subnets": [
    {
      "subnet_id": "2fq7c-slacv-26cgz-vzbx2-2jrcs-5edph-i5s2j-tck77-c3rlz-iobzx-mqe",
      "membership": [
        "2grd6-wl4h5-ckvc2-agagg-kn5it-axvmv-4nogx-frgyx-5ulsj-kuoyo-lae",
...

History: Show registry data of specified versions

# output
[
  {
    "version": 55469,
    "key": "crypto_record_mcmqr-z4yrw-7wnwf-au7wv-5f7az-fco3a-vuxx3-7lol5-sigpc-jtnqq-aqe_5",
    "value": {
      "bytes_base64": "EBAaIQNAc14Qik6iw7yw87bOz7r5mtsEZFAFQzCW/MNYHEsclioHCOSwzsmyMw=="
    }
  },
  {
    "version": 55470,
    "key": "crypto_record_j4et3-lkqhr-32t4q-3o57n-nm7u3-hvgsd-7v574-3z7mj-eyks5-twtxo-zae_5",
    "value": {
      "bytes_base64": "EBAaIQLSq5kQGSfxFp9P8/HeJIZ0C+iWCrCwhj16vOyCgMgV6ioHCK2MvcuyMw=="
    }
  },
  {
...

Diff: Show diff of the data between two aggregated versions

# output
---
       "node_provider_principal_id": "wwdbq-xuqhf-eydzu-oyl7p-ga565-zm7s7-yrive-ozgsy-zzgh3-qwb3j-cae",
        "dc_id": "at2",
        "rewardable_nodes": {
 -        "type1.1": 14
 +        "type1.1": 28
        },
        "max_rewardable_nodes": {
          "type1.1": 14
 ---
       "node_operator_principal_id": "yedtm-rm5av-s256v-zzi4w-7lxen-koqg6-pzak3-rjzko-xfu2c-dw7eo-bae",
        "node_provider_principal_id": "hycj4-e3jwh-l2bqz-ohuxh-tu4af-agzov-uugg6-j57rk-b6opc-fx3ml-kqe",
        "dc_id": "ag1",
 -      "rewardable_nodes": {},
 +      "rewardable_nodes": {
 +        "type3.1": 1
 +      },
        "max_rewardable_nodes": {
          "type3.1": 1
        },
...

Manual Testing:

  • dre registry diff
  • dre registry diff -1
  • dre registry diff -5
  • dre registry diff -5 -2
  • dre registry diff
  • dre registry diff -o /tmp/sev_diff.txt
  • dre registry diff -f "principal == acqus-l4yyc-h44lw-grfxw-h7jqf-mtvt3-huwmj-4s372-sc5db-5nsfr-2ae"
  • dre registry get
  • dre registry get -5
  • dre registry get 55400
  • dre registry get -o /tmp/sev_get.txt
  • dre registry get -f "principal == 64xe5-tx2s3-4gjmj-pnozr-fejw2-77y5y-rhcjk-glnmx-62brf-qin5q-pqe"
  • dre registry history
  • dre registry history -5
  • dre registry history 55400
  • dre registry history -o /tmp/sev_history.txt
  • dre registry history -f "key == crypto_record_rtjw5-ja7cv-j7nyl-jc5mc-t7lol-wjouh-nh6tm-baoba-wzra6-toyp5-iqe_5"
  • same output for arguments that refer to the same version
cargo run registry get -o /tmp/sev_no.txt
cargo run registry get -1 -o /tmp/sev_minusone.txt
cargo run registry get 55488 -o /tmp/sev_55488.txt

@severin-amrein severin-amrein force-pushed the sev/dre-registry-diff branch 2 times, most recently from 9771903 to 6f57947 Compare December 17, 2025 14:34
Copy link
Contributor

@NikolaMilosa NikolaMilosa left a comment

Choose a reason for hiding this comment

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

General comment: dre registry is used in a lot of our tooling (that isn't all in this repo sadly) and changing its interface will demand a lot of additional work that we may not even see now. I suggest one of the following:

  • Leave current dre registry as is, extract the things that you need in a module and make your own new command for the diff
  • Somehow keep the old behavior as is dre registry > dumps the registry

Personally I think that the first one is easier

I'll let @pietrodimarco-dfinity finish the review as he has more insights into what is needed. These are just styling comments.

@severin-amrein severin-amrein marked this pull request as ready for review December 18, 2025 16:54
@severin-amrein severin-amrein requested a review from a team as a code owner December 18, 2025 16:54
@severin-amrein severin-amrein marked this pull request as draft December 22, 2025 15:04
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.

3 participants