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

[Feature] Node rewards chain explorer. Resolves [#413] #575

Merged

Conversation

apoorv-2204
Copy link
Contributor

@apoorv-2204 apoorv-2204 commented Sep 16, 2022

Description

It adds a Reward chain explorer to UI, which includes :node_rewards and :mint_rewards tx types in chronological order.

Fixes

Type of change

Please delete options that are not relevant.

  • Minor fix

    • Name change: get_gen_addr : genesis_address , wherever applicable.
    • Minor spec changes from number to non_negative_number for index.
    • Correct typos.
  • New feature (non-breaking change which adds functionality)

    • New Reward explorer Ui.
    • New db method list_chain_addresses , takes genesis address and return a stream of address in old to recent order.
  • This change requires a documentation update

    • Brief Reward chain desc was given under /explorer/chain/rewards UI.
  • Review_changes

    • Transactions appear in page w.r.t previous page time reference.
    • Display pages according to nb of transactions.
    • ex: 40 transaction 4 page .
      Screenshot_20220920_142749
  • Deterministic test

    • for faucet_controller_test.exs
  • ####Future Improvements

    • ets table with DE - queue
    • Stream Transaction one by one from DB.

How Has This Been Tested?

  • Unit Test cases were included wherever necessary
  • Integration tests were included for live view
  • DB tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@apoorv-2204 apoorv-2204 self-assigned this Sep 16, 2022
@apoorv-2204 apoorv-2204 added UI Invole user interface DB Involve database core team Assigned to the core team labels Sep 16, 2022
@apoorv-2204 apoorv-2204 marked this pull request as ready for review September 16, 2022 14:10
@samuelmanzanera
Copy link
Member

I got the previous button the first page

image

<h1 class="subtitle is-size-4 heading has-text-white">Reward Chain</h2>
</div>
<div class="message-body">
Reward Chains are the basis for remuneration. During self-repair, <strong>Archethic Rewards</strong> are created and distributed to Miners.
Copy link
Member

Choose a reason for hiding this comment

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

This is not really accurate, actually the rewards are not sent during self-repair, but the fees burnt are collected during self-repair. The rewards transactions are sent at a specific interval later, once per cycle.

@samuelmanzanera
Copy link
Member

There is an issue with the pagination:

Page1 is ended with 2022/09/16 14:34:30
image

Page2: is started with 2022/09/16 14:39:30
image

@samuelmanzanera
Copy link
Member

samuelmanzanera commented Sep 19, 2022

Looks like good!
I just have one remark, when we reach 10 and 10 on 2 pages, I have a third empty page. Best would be to not showing it.
Maybe due to this one:

|> assign(:nb_pages, div(txn_count, @display_limit) + 1)

@samuelmanzanera
Copy link
Member

If I wait on the first page, the transactions are accumulated but the pagination is not activated. If I refresh after I will the see the pagination.
Maybe we should detect when we reach the 10txs, to display only the last 10 on the screen while activating the pagination.

Copy link
Member

@samuelmanzanera samuelmanzanera left a comment

Choose a reason for hiding this comment

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

Looks good

@samuelmanzanera samuelmanzanera merged commit f3449bd into archethic-foundation:develop Sep 26, 2022
@apoorv-2204 apoorv-2204 deleted the node_rewards_live branch September 26, 2022 06:40
@apoorv-2204
Copy link
Contributor Author

Closing Comment:
we must leverage ets, queue for cache. Or may be idea from google/guava.

@samuelmanzanera samuelmanzanera added the feature New feature request label Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core team Assigned to the core team DB Involve database feature New feature request UI Invole user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants