Duniter squid release candidate 0.3.0-rc still has some bugs

I am testing a new version of duniter squid that integrates this feature : Add balances to squid accounts and fixes some bugs introduced in the start of MR !27.

  • genesis has been refactored a bit, the new cert_hist.json file format is the one from py-g1-migrator MR !7
  • the treasury initial balance is now handled (with hardcoded accountid)
  • account now has two new fields
    • balance = an up-to-date value of the free balance
    • totalBalance = the free balance plus the unclaimed UDs if the account has an identity

This version is currently running on my node squid.gdev.coinduf.eu (#40 would be a nice and easy contribution to monitor updates).

The images are currently available on my docker hub (h30x/duniter-squid:latest and h30x/duniter-squid-hasura:latest). They could become available on duniter registry when :

  • py-g1-migrator MR is merged and new cert_hist.json is published somewhere for the CI
  • the MR is approved and merged and the CI runs

The re-synchronization of the indexer is a bit long (~ 3 hours) since we already have more than 6 million blocks on gdev.

There is still a major bug: the amount of totalBalance is not the same after my refactor as the one before implemented by poka:

query Q {
  identity(where: {name: {_eq: "poka"}}) {
    account {
      balance 
      totalBalance
    }
    firstEligibleUd
  }
}

squid.gdev.coinduf.eu
{
  "data": {
    "identity": [
      {
        "account": {
          "balance": 10137381854845760,
          "totalBalance": 35502720024874770
        },
        "firstEligibleUd": 2506
      }
    ]
  }
}

gdev-squid.axiom-team.fr
{
  "data": {
    "identity": [
      {
        "account": {
          "balance": 10137381854845760,
          "totalBalance": 35696499692910204
        },
        "firstEligibleUd": 2506
      }
    ]
  }
}

Balance is the same but the computed unclaimed UD is not event the firstEligibleUd is the same (2506).

And there is another problem:

query Q {
  identity(where: {name: {_eq: "HugoTrentesaux"}}) {
    account {
      balance 
      totalBalance
    }
    firstEligibleUd
  }
}

squid.gdev.coinduf.eu
{
  "data": {
    "identity": [
      {
        "account": {
          "balance": 24942420883833960,
          "totalBalance": 32517093467543780
        },
        "firstEligibleUd": 2623
      }
    ]
  }
}

gdev-squid.axiom-team.fr
{
  "data": {
    "identity": [
      {
        "account": {
          "balance": 24942420883833960,
          "totalBalance": 32796572695269100
        },
        "firstEligibleUd": 2622
      }
    ]
  }
}

On my account, the first eligible ud is not even the same (2622 against 2623).

I check against Duniter :

{
  data: {
    firstEligibleUd: 2,623
  }
  nextCreatableIdentityOn: 5,560,015
  oldOwnerKey: [
    5DSF5HxiQvy2xJdtdtMSPYZdSoLAsGDxzJaifiAfAByinrH4
    26,281
  ]
  ownerKey: 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz
  nextScheduled: 0
  status: Member
}

We see that the correct value for first eligible ud according to Duniter si 2623.

Let’s see what happen if I claim my UDs:

query Q {
  identity(where: {name: {_eq: "HugoTrentesaux"}}) {
    account {
      balance 
      totalBalance
    }
    firstEligibleUd
  }
}

 squid.gdev.coinduf.eu
{
  "data": {
    "identity": [
      {
        "account": {
          "balance": 32567971999442228,
          "totalBalance": 32567971999442228
        },
        "firstEligibleUd": 2652
      }
    ]
  }
}

gdev-squid.axiom-team.fr
{
  "data": {
    "identity": [
      {
        "account": {
          "balance": 32567971999442228,
          "totalBalance": 32567971999442228
        },
        "firstEligibleUd": 2652
      }
    ]
  }
}

After claiming the UD, both implementations agree that the balance is equal to the totalBalance (32567971999442228), but this corresponds to none of the previously predicted amount.

In conclusion, both implementations still differ from Duniter’s implementation :scream:

We must add some unit tests on SQL function to make sure that the predicted total balance is the same as Duniter!!

5 Likes