Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pool updates not including deregistration events #240

Closed
robinboening opened this issue Oct 9, 2023 · 5 comments · Fixed by #238
Closed

pool updates not including deregistration events #240

robinboening opened this issue Oct 9, 2023 · 5 comments · Fixed by #238

Comments

@robinboening
Copy link

Describe the bug
I find the response from the pool_updates endpoint a bit confusing. However, for this issue I want to solely focus on the fact that it doesn't include pool deregistration events, which I believe counts as updates.

To Reproduce
Steps to reproduce the behavior:

  1. query some retired pool, e.g. pool1y2gynck9pd4en5rzm0rueqd2qm7sw89aqmkcntd899vv237qj38
  2. the response includes an array with two items: the first is the initial registration (not visible in the response), the second is an update.

This is no exception. You'll see the same behaviour if you request updates for a different retired pool, like pool1dmpzsnuwxy44ky3dskuhmwpglumy6j0rc5wyfxlu3zym798f79g

Expected behavior
For the above example, the response should not include 2 but 4 items as are two deregistration transactions available onchain. For comparison, please see blockfrost's response in the screenshot.

Screenshots

Koios response
Screenshot 2023-10-09 at 11 00 18

blockfrost response
Screenshot 2023-10-09 at 11 01 45

@rdlrt
Copy link
Contributor

rdlrt commented Oct 9, 2023

Thanks for raising, I agree this is a missed functional test on pool cache on koios backend, will get it fixed for v1 PR (#238)

@rdlrt
Copy link
Contributor

rdlrt commented Oct 12, 2023

@robinboening - For the context of this issue, could you confirm the below looks correct (as in expected) change outcome? You can find more details here, sample output below. This includes a change to pool_status field to update_type which will return simply registered or retired - accordingly other fields in the request may be set to null (eg: pool params/relays/owners/etc update will return null for an entry for deregistration.

curl -s "http://127.0.0.1:8053/api/v1/pool_updates?_pool_bech32=pool1y2gynck9pd4en5rzm0rueqd2qm7sw89aqmkcntd899vv237qj38&select=tx_hash,block_time,pool_id_bech32,margin,update_type"  | jq .
[                    
  {                                                                                                                    
    "tx_hash": "c82be7377e18a53d7568e27796f1bfb6646930ff645c524f58b403bbb91bbcf0",
    "block_time": 1657062375,                                                                                          
    "pool_id_bech32": "pool1y2gynck9pd4en5rzm0rueqd2qm7sw89aqmkcntd899vv237qj38",                                      
    "pool_id_hex": "229049e2c50b6b99d062dbc7cc81aa06fd071cbd06ed89ada72958c5",                                         
    "active_epoch_no": null,                                                                                           
    "vrf_key_hash": null,       
    "margin": null,                  
    "fixed_cost": null,     
    "pledge": null,                                                                                                    
    "reward_addr": null,
    "owners": null,                                                                                                    
    "relays": null,
    "meta_url": null,
    "meta_hash": null,
    "meta_json": null,
    "update_type": "retired",
    "retiring_epoch": 352
  },
  {
    "tx_hash": "3c4535644403fa41a3af0108ba38bbc2b6edd3c5188f253e312c8fcd92b1790d",
    "block_time": 1657043603,
    "pool_id_bech32": "pool1y2gynck9pd4en5rzm0rueqd2qm7sw89aqmkcntd899vv237qj38",
    "pool_id_hex": "229049e2c50b6b99d062dbc7cc81aa06fd071cbd06ed89ada72958c5",
    "active_epoch_no": null,
    "vrf_key_hash": null,
    "margin": null,
    "fixed_cost": null,
    "pledge": null,
    "reward_addr": null,
    "owners": null,
    "relays": null,
    "meta_url": null,
    "meta_hash": null,
    "meta_json": null,
    "update_type": "retired",
    "retiring_epoch": 350
  },
  {
  {                                                                                                                                                                                                                                  [80/3053]
    "tx_hash": "68539421cb3becec682f60f3e28317245f832e245b439fb5c29821cf6982abb7",
    "block_time": 1647440800,
    "pool_id_bech32": "pool1y2gynck9pd4en5rzm0rueqd2qm7sw89aqmkcntd899vv237qj38",
    "pool_id_hex": "229049e2c50b6b99d062dbc7cc81aa06fd071cbd06ed89ada72958c5",
    "active_epoch_no": 329,
    "vrf_key_hash": "16f516e458beeb1545740ed9ce19fc402f83f67a7fef798d5f4289004767e67b",
    "margin": 0,
    "fixed_cost": "340000000",
    "pledge": "1000000000",
    "reward_addr": "stake1uyps0pp6t8fu64zshjf8vqvac3pjjruycavpth9n832mzkgvwq7md",
    "owners": [
      "stake1uyps0pp6t8fu64zshjf8vqvac3pjjruycavpth9n832mzkgvwq7md"
    ],
    "relays": [
      {
        "dns": "1.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "2.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "3.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "4.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "5.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "6.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      }
    ],
    "meta_url": "https://pool.maladex.com/anmal/poolMetaData.json",
    "meta_hash": "7c99889f76564cffcde0050ab039401d219a2b9999b4cfd41d32ddf8bfb2a383",
    "meta_json": {
      "name": "ANMAL - Retiring Maladex's Pool.",
      "ticker": "ANMAL",
      "homepage": "https://maladex.com",
      "description": "ANMAL is the retiring pool of Maladex. Please, redelegate."
    },
    "update_type": "registered",
    "retiring_epoch": null
  },
  {
    "tx_hash": "ba5973e8f833030e9a82a9e2634a5cc9970ff7d57244bd9394f5b6426fde7146",
    "block_time": 1638401908,
    "pool_id_bech32": "pool1y2gynck9pd4en5rzm0rueqd2qm7sw89aqmkcntd899vv237qj38",
    "pool_id_hex": "229049e2c50b6b99d062dbc7cc81aa06fd071cbd06ed89ada72958c5",
    "active_epoch_no": 308,
    "vrf_key_hash": "16f516e458beeb1545740ed9ce19fc402f83f67a7fef798d5f4289004767e67b",
    "margin": 0.99,
    "fixed_cost": "350000000",
    "pledge": "10000000000",
    "reward_addr": "stake1uyps0pp6t8fu64zshjf8vqvac3pjjruycavpth9n832mzkgvwq7md",
    "owners": [
      "stake1uyps0pp6t8fu64zshjf8vqvac3pjjruycavpth9n832mzkgvwq7md"
    ],
    "relays": [
      {
        "dns": "1.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "2.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "3.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "4.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "5.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      },
      {
        "dns": "6.relay.maladex.com",
        "srv": null,
        "ipv4": null,
        "ipv6": null,
        "port": 6000
      }
    ],
    "meta_url": "https://pool.maladex.com/anmal/poolMetaData.json",
    "meta_hash": "b4b83c0b9bc6d2930f7be4bd6a409f010d19f9faa9a3d05ad2745ec146d8ea31",
    "meta_json": null,
    "update_type": "registered",
    "retiring_epoch": null
  }
]

@rdlrt rdlrt mentioned this issue Oct 12, 2023
59 tasks
rdlrt added a commit that referenced this issue Oct 13, 2023
## Description
<!--- Describe your changes -->
[Re-created from #227 post renaming base-branch]

- [x] pool_list: Return all fields from pool_info_cache (latest pool entry)
- [x] Remove filter for returning only 'registered' pools from pool_list, pool_relays and pool_metadata endpoints
- [x] Few more linting polishing (remove trailing spaces, move single column/table references onto same line)
- [x] Update pool_info to return same metadata as pool_list and pool_metadata (latest w/o fallback)
- [x] Update all tx_in joins to use the new tx_out.consumed_by_tx_in_id
- [x] Dont include epoch_params in epoch_info_cache, update references accordingly
- [x] Update `*_txs` as per #186 (point 4)
- [x] Update `*_utxos` as per #186 (point 3)
  - [x] credential_utxos
  - [x] address_utxos
  - [x] account_utxos
  - [x] utxo_info
  - [x] asset_utxos
  - [x] script_utxos
- [x] Add script_info and align all endpoints for scripts
- [x] Add temporary cron for fixing epoch count mismatch
- [x] Add pool_registrations/pool_deregistrations endpoint
- [x] Add retired txs to `pool_updates` (other fields for such transactions will return `null`)
- [x] Add reward_withdrawals/treasury_withdrawals endpoint
- [x] Simplify address_assets and account_assets heirarchy to return flat table (helps do horizontal filtering as desired)
- [x] API Spec updates:
  - [x] Add section for Authentication
  - [x] Bump Koios version
  - [x] pool_list
  - [x] pool_metadata
  - [x] pool_relay
  - [x] `*_txs`
  - [x] `*_utxos`
  - [x] `address_assets`
  - [x] `account_assets`
  - [x] `epoch_params`
  - [x] `pool_registrations`/`pool_deregistrations`
  - [x] `reward_withdrawals`/`treasury_withdrawals`
  - [x] All script-related endpoints
  - [x] Update examples
  - [x] Check re-usability
  - [x] Check schemathesis
    - [x] guild
    - [x] preview
    - [x] preprod
    - [x] mainnet
- [x] Add v0 vs v1 to monitoring
  - [x] guild
  - [ ] preview (post merge)
  - [ ] preprod (post merge)
  - [ ] mainnet (post 1.1.0 - instead of 1.1.0rc) release

- [x] Ogmios
  - [x] Add integration for tx Evaluation and submission using ogmios path
  - [x] Add health check based on /health (`version` and `networkSynchronization`)
- [x] Update CHANGELOG
- [x] Bump final specs version number to v1 

## Which issue it fixes?
<!--- Link to issue: Closes #issue-number -->
- [x] Closes #208
- [x] Closes #218
- [x] Closes #186 
- [x] Closes #221
- [x] Closes #224
- [x] Closes #191
- [x] Closes #232
- [x] Closes #240 #241

---------

Co-authored-by: KoT_B_KocMoce <[email protected]>
Co-authored-by: Ola [AHLNET] <[email protected]>
@robinboening
Copy link
Author

robinboening commented Oct 16, 2023

Sorry for the delay! I finally had a chance to look at the changes and it looks great to me!

A few questions though. Based on the above example, imagine there was another update after the deregistration only updating pledge

  • would retiring_epoch be populated or be null?
  • would update_type be registration or be deregistration?
  • All columns except pledge would be null? (and except the obvious columns like tx_hash, block_time, etc)

If there was a reregistration after the deregistration, I assume update_type would be registration and retiring_epoch be null, right?

Thank you!

~Robin

@robinboening
Copy link
Author

Is v1 already available for beta use? Or is it going to be launched later in the future?

@rdlrt
Copy link
Contributor

rdlrt commented Oct 16, 2023

A few questions though. Based on the above example, imagine there was another update after the deregistration only updating pledge

  • would retiring_epoch be populated or be null?

Yes, since it is a registration entry - retiring_epoch will be null, as it will correspond to what's in the pool update [registration] certificate

  • would update_type be registration or be deregistration?

It would be registration as that's what the tx contains.

  • All columns except pledge would be null? (and except the obvious columns like tx_hash, block_time, etc)

All other columns will have value, since pool registration does not have empty fields for things like pool margin, fee, owners, relays, etc.

If there was a reregistration after the deregistration, I assume update_type would be registration and retiring_epoch be null, right?

Correct

Is v1 already available for beta use? Or is it going to be launched later in the future?

v1.1.0rc release on guild and preview should be in 24 hours (this will be in addition to continue serving v0), while for preprod and mainnet will follow after a few days of testing in the field to capture feedback

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 a pull request may close this issue.

2 participants