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

Light mode: hardcode epoch/era conversion for the Testnet #3222

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

Unisay
Copy link
Contributor

@Unisay Unisay commented Apr 6, 2022

Issue Number

ADP-1422, ADP-1504

Overview

Light-mode (Epic ADP-1422) aims to make synchronisation to the blockchain faster by trusting an off-chain source of aggregated blockchain data.

In this pull request, we implement a function currentNodeEra that that determines current Era by the current epoch retrieved from the Testnet Blockfrost API.

@Unisay Unisay self-assigned this Apr 6, 2022
@Unisay Unisay force-pushed the yura/ADP-1504/current-node-era branch from d5aa0e4 to 72ee3a1 Compare April 6, 2022 16:34
Copy link
Contributor

@HeinrichApfelmus HeinrichApfelmus left a comment

Choose a reason for hiding this comment

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

@Unisay Unisay force-pushed the yura/ADP-1504/current-node-era branch from c8b8550 to f9acdb5 Compare April 8, 2022 07:41
@Unisay Unisay force-pushed the yura/ADP-1504/current-node-era branch from f9acdb5 to 46f3d24 Compare April 8, 2022 07:43
AnyCardanoEra ByronEra -> 0
Testnet magic ->
error $ "Epoch/Era conversion isn't provided for the Testnet "
<> show magic <> " in light mode."
Copy link
Contributor

Choose a reason for hiding this comment

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

Since with Blockfrost provider we are supporting only mainnet and public testnet (i.e. the one with protocolMagic -> 1097911063) then perhaps we shouldn't be able to start wallet against any different testnet alltogether. E.g.:

If we start wallet with:

cardano-wallet serve \
  --light \
  --blockfrost-token-file blockfrost.api.key \
  --testnet testnet-byron-genesis.json

and testnet-byron-genesis.json contains protocolMagic different than 1097911063 the wallet should just stop with the appropriate message.

Maybe it's not in scope of this pr though

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe starting against public testnet could be simple as:

cardano-wallet serve \
  --light \
  --blockfrost-token-file blockfrost.api.key \
  --testnet

i.e. without the byron-genesis.json, assuming it is needed only for getting the protocolMagic from.

@Unisay
Copy link
Contributor Author

Unisay commented Apr 8, 2022

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Apr 8, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit aed9240 into master Apr 8, 2022
@iohk-bors iohk-bors bot deleted the yura/ADP-1504/current-node-era branch April 8, 2022 15:14
WilliamKingNoel-Bot pushed a commit that referenced this pull request Apr 8, 2022
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 this pull request may close these issues.

3 participants