polkadot-wiki icon indicating copy to clipboard operation
polkadot-wiki copied to clipboard

Use GitHub Actions to add new auction blocks to the auction schedule tool

Open alfarok opened this issue 2 years ago • 0 comments

https://github.com/w3f/polkadot-wiki/pull/3814 introduces a new react component that visualizes auction data for Polkadot and Kusama on the wiki/guide. The block date/times are estimated based on the live chain state when the page loads.

https://github.com/w3f/polkadot-wiki/issues/3768 was the original task that called for this migration and move to using on-chain data for better time estimates. The last step in fully automating this process would be to add a new GitHub action that updates the auctions.js file to occasional check for new auction blocks that will occur in the future. We currently have hard-coded values pretty far into the future but to make this tool completely hands-off we can leverage GitHub actions to occasionally perform a check and open a new PR with the additions.

This tool will not have to run frequently (maybe once a month) but it will prevent us from having to manually remembering to do this on occasion. The tool should simple check if any new auctions are scheduled that do not exist in the PolkadotAuctions.json and/or KusamaAuctions.json files, if so append the blocks and create a new PR.

It would be inefficient to try and pull all of this data live every time the page loads, which is why the blocks are cached in PolkadotAuctions.json and KusamaAuctions.json files. It keeps the tool snappy and avoids making 100+ RPC calls every time the page loads.

Lastly, it may be worth adding block timestamps to the schema if the block has already reach finality. This will further reduce latency from on-chain calls where the values will never change.

alfarok avatar Sep 26 '22 03:09 alfarok