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

[BUG] - Cardano.API.Block.getBlockHeader Not Implemented for Alonzo Era #3139

Closed
bwbush opened this issue Aug 29, 2021 · 1 comment · Fixed by #3158
Closed

[BUG] - Cardano.API.Block.getBlockHeader Not Implemented for Alonzo Era #3139

bwbush opened this issue Aug 29, 2021 · 1 comment · Fixed by #3158
Labels
Alonzo/Plutus Relates to the Alonzo era/Plutus core bug Something isn't working

Comments

@bwbush
Copy link
Contributor

bwbush commented Aug 29, 2021

External

Area
Other Cardano Node API for Alzono Ledger

Summary
Cardano.API.Block.getBlock is not implemented for the Alonzo era: see https://github.com/input-output-hk/cardano-node/blob/4c59442958072657812c6c0bb8e0b4ab85ce1ba2/cardano-api/src/Cardano/Api/Block.hs#L252.

Steps to reproduce
Pattern match against Cardano.Api.Block and access the BlockHeader there.

getBlockHeader: Alonzo era not implemented yet                                                                                                                                                          
CallStack (from HasCallStack):                                                                                                                                                                                  
 error, called at src/Cardano/Api/Block.hs:252:28 in cardano-api-1.29.0-7V17SdPKJdQHtDCNFR9H0F:Cardano.Api.Block                                                                                               

Expected behavior
Pattern matching on Cardano.API.Block or calling Cardano.API.Block.getBlockHeader should work for Alonzo as it does for other eras.

System info (please complete the following information):

  • OS Name: NixOS
  • OS Version: 20.03.3328.6d1a044fc9f
  • Node version 1.29.0 - linux-x86_64 - ghc-8.10 git rev 4c59442

Additional context
Is there a workaround for this? I've been using this function to find the slot number of the current block (not the tip) when running a chain sync client: I need that in order to monitor rollbacks and revise the cached history of the parts of the ledger relevant to my application.

@bwbush bwbush added the bug Something isn't working label Aug 29, 2021
@bwbush
Copy link
Contributor Author

bwbush commented Sep 2, 2021

I just verified that running scan-blocks of cardano-node/cardano-client-demo/ on testnet (not the hardcoded mainnet) fails with this same error, just after block 2877000 when it reaches Alonzo:

scan-blocks: getBlockHeader: Alonzo era not implemented yet
CallStack (from HasCallStack):
  error, called at src/Cardano/Api/Block.hs:252:28 in cardano-api-1.29.0-inplace:Cardano.Api.Block

@dorin100 dorin100 added the Alonzo/Plutus Relates to the Alonzo era/Plutus core label Sep 3, 2021
@iohk-bors iohk-bors bot closed this as completed in 53fd9ec Sep 3, 2021
bwbush added a commit to functionally/mantis that referenced this issue Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Alonzo/Plutus Relates to the Alonzo era/Plutus core bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants