After investigation with Pallas developers, it appears that there is an offset of 1 which comes from the implementation of the Cardano node itself:
The Era enum is a direct mapping of the cbor wrapper flag that is found in blocks via chain-sync.
The era returned via local-state queries is different.
One is the official era sequence and the other is the protocol version.
What
Fix the era conversion in the Pallas chain observer to return the correct epoch
How
[x] Fix the conversion done by the Pallas chain observer: Era::try_from(era + 1)
[x] Add a comment explaining that "The era value returned from the queries_v16::get_current_era has an offset of -1 with the era value of the pallas_traverse::Era due to Cardano node implementation and it needs to be compensated to get the correct era display name.`
Why
The
/status
route returns an unexpectedBabagge
era when the Cardano node is runningConway
ontesting-preview
andtesting-sanchonet
:Investigation
After investigation with
Pallas
developers, it appears that there is an offset of1
which comes from the implementation of the Cardano node itself:Era
enum is a direct mapping of the cbor wrapper flag that is found in blocks via chain-sync.What
Fix the era conversion in the Pallas chain observer to return the correct epoch
How
Era::try_from(era + 1)
queries_v16::get_current_era
has an offset of-1
with the era value of thepallas_traverse::Era
due to Cardano node implementation and it needs to be compensated to get the correct era display name.`