Skip to content

feat: exposed era in chainsync input #373

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

Merged
merged 5 commits into from
Mar 4, 2025
Merged

Conversation

jkawan
Copy link
Contributor

@jkawan jkawan commented Mar 1, 2025

  1. Exposed/Added era in chainsync input while updating status
  2. Added unit test to test if era is added during status update

@jkawan jkawan requested a review from a team as a code owner March 1, 2025 18:53
Copy link
Contributor

@agaffney agaffney left a comment

Choose a reason for hiding this comment

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

Instead of using the slot number to determine the era, we can use the block type. There should be an Era() function on the block object that tells us which era that it's from. This won't work for rollback, but we can leave the era blank like we do for block number.

default:
return "Conway" // future era
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These values are only valid for one particular network (presumably mainnet). We should either make sure they are only consulted for that one network, or that we provide values for additional well-known networks (such as preview and preprod)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have made the changes to use the Era name from block, could you please review.

Copy link
Contributor

@agaffney agaffney left a comment

Choose a reason for hiding this comment

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

Assuming that this is for #129, we want to add the era to the event context. It's probably not particularly useful to expose via the "update status" callback. We should probably be able to do everything we need in the NewBlockContext() function

@agaffney agaffney merged commit 7e1af56 into main Mar 4, 2025
8 checks passed
@agaffney agaffney deleted the feat/added-era-in-context branch March 4, 2025 18:45
@jkawan jkawan linked an issue Mar 4, 2025 that may be closed by this pull request
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.

Expose era and block/tx type in chainsync input
2 participants