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

Discrepancies 9.0.0 <-> 10.0.1 #714

Closed
1000101 opened this issue Jul 28, 2021 · 4 comments
Closed

Discrepancies 9.0.0 <-> 10.0.1 #714

1000101 opened this issue Jul 28, 2021 · 4 comments

Comments

@1000101
Copy link
Contributor

1000101 commented Jul 28, 2021

I have discovered some oddities between v9 and v10 so I thought a report could help.

Running from fresh (resynced from start) c334c12.

  1. active_epoch_no in a tx with pool update certificate has changed.
SELECT
  pu.id,  
  pu.cert_index,
  ph.view,
  pu.active_epoch_no
FROM tx
  JOIN pool_update pu ON (pu.registered_tx_id = tx.id)
  JOIN stake_address sa ON (sa.hash_raw = pu.reward_addr)
  JOIN pool_hash ph ON (ph.id = pu.hash_id)
WHERE encode(tx.hash, 'hex') = '28bd5e8c342ab89d6642e446cb299058ea36256af1718e4af9326898ce4192d7';


9:
  id   | cert_index |                           view                           | active_epoch_no 
-------+------------+----------------------------------------------------------+-----------------
 10714 |          0 | pool1kchver88u3kygsak8wgll7htr8uxn5v35lfrsyy842nkscrzyvj |             250
 10715 |          1 | pool1s7t7mfc89syw93h07aammaccnua66yn6d4l0mqt7zqurz2mczvq |             250


10:
  id   | cert_index |                           view                           | active_epoch_no 
-------+------------+----------------------------------------------------------+-----------------
 10963 |          0 | pool1kchver88u3kygsak8wgll7htr8uxn5v35lfrsyy842nkscrzyvj |             249
 10964 |          1 | pool1s7t7mfc89syw93h07aammaccnua66yn6d4l0mqt7zqurz2mczvq |             249

  1. rewards have changed.
SELECT es.epoch_no AS "epoch",
  COALESCE(
    (
      SELECT COALESCE(SUM(amount), 0)
      FROM reward r
        JOIN pool_hash ph ON (ph.id = r.pool_id)
      WHERE epoch_no = es.epoch_no
        AND ph.view = 'pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy'
    ),
    0
  ) AS "rewards"
FROM epoch_stake es
  JOIN epoch e ON (e.no = es.epoch_no)
  JOIN pool_hash ph ON (es.pool_id = ph.id)
WHERE ph.view = 'pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy'
AND epoch_no = 219
GROUP BY es.epoch_no;

9:
 epoch |   rewards        
-------+-------------+------------
   219 | 94039389443 | 

10:
 epoch |   rewards       
-------+-------------+------------
   219 | 94039391171 

@erikd
Copy link
Contributor

erikd commented Jul 29, 2021

Rewards have been incorrect. There have been a number of changes that have either already been applied or in the process of being worked on.

As part of this process we will be adding new validations (#711 and #718).

@1000101
Copy link
Contributor Author

1000101 commented Jul 30, 2021

Thanks for the information! And what about the first issue - different active_epoch_no?

@erikd
Copy link
Contributor

erikd commented Aug 4, 2021

In an earlier version active_epoch_no was incorrect. It has since been fixed (commit c226c4b).

@1000101
Copy link
Contributor Author

1000101 commented Aug 4, 2021

In an earlier version active_epoch_no was incorrect. It has since been fixed (commit c226c4b).

Thank you very much!

@1000101 1000101 closed this as completed Aug 4, 2021
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

No branches or pull requests

2 participants