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

feat: add Shelley protocol parameters support #587

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

verbotenj
Copy link
Contributor

@verbotenj verbotenj commented Apr 17, 2024

Test

make
./gouroboros -address backbone.cardano-mainnet.iohk.io:3001 -network mainnet -ntn chain-sync -bulk -start-era shelley
...
era = Shelley, slot = 16588702, block_no = 5086521, id = 2772d6484501a4183f3c2376536234c0a27e1da1ed282f9fd1b32890605ee241
era = Shelley, slot = 16588719, block_no = 5086522, id = 7fdf13dc47bc43fe921da6a9bff4ff1c95f2a257a93e1a4c58c13ef7df461545
era = Shelley, slot = 16588737, block_no = 5086523, id = 4e9bbbb67e3ae262133d94c3da5bffce7b1127fc436e7433b87668dba34c354a
era = Allegra, slot = 16588800, block_no = 5086524, id = 078d102d0247463f91eef69fc77f3fbbf120f3118e68cd5e6a493c15446dbf8c

Closes #324

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.

Please add a ShelleyProtocolParameters type (the equivalent of BabbageProtocolParameters) and wire it up in local-state-query. This should really just be copying ShelleyProtocolParameterUpdate, adding cbor.StructAsArray at the top, removing all of the field annotations, and making the protocol major/minor top-level fields.

Tau *cbor.Rat `cbor:"11,keyasint"`
DDecentralization *cbor.Rat `cbor:"12,keyasint"`
Nonce *cbor.Rat `cbor:"13,keyasint"`
ProtocolVersion []uint `cbor:"14,keyasint"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Use an embedded struct to capture the major/minor protocol version in named fields like we did for the Babbage protocol parameters:

	ProtocolVersion    struct {
		cbor.StructAsArray
		Major uint
		Minor uint
	} `cbor:"14,keyasint"`

A0 *cbor.Rat `cbor:"9,keyasint"`
Rho *cbor.Rat `cbor:"10,keyasint"`
Tau *cbor.Rat `cbor:"11,keyasint"`
DDecentralization *cbor.Rat `cbor:"12,keyasint"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Get rid of the doubled D at the beginning of this field name

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.

Comments above

@verbotenj verbotenj force-pushed the shelley-protocol-param-support branch 2 times, most recently from 4d010a1 to c4a65f0 Compare April 17, 2024 11:53
ProtocolMinor uint
Decentralization *cbor.Rat
Nonce *cbor.Rat
ProtocolVersion []uint
Copy link
Contributor

Choose a reason for hiding this comment

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

This would instead be two top level fields for major/minor like we have for Babbage...for reasons

@verbotenj verbotenj force-pushed the shelley-protocol-param-support branch 2 times, most recently from 4097b7e to 778a8cf Compare April 17, 2024 14:28
@verbotenj verbotenj force-pushed the shelley-protocol-param-support branch from 778a8cf to 195b533 Compare April 17, 2024 14:49
@verbotenj verbotenj merged commit 7df13a3 into main Apr 17, 2024
8 checks passed
@verbotenj verbotenj deleted the shelley-protocol-param-support branch April 17, 2024 15:02
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.

Shelley protocol params support
2 participants