Skip to content

Commit 8312b54

Browse files
authored
feat: added protocol versions to map (#1241)
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
1 parent 8e556fe commit 8312b54

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

ledger/era.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ var BlockHeaderToBlockTypeMap = map[uint]uint{
3535
BlockHeaderTypeAlonzo: BlockTypeAlonzo,
3636
BlockHeaderTypeBabbage: BlockTypeBabbage,
3737
BlockHeaderTypeConway: BlockTypeConway,
38+
BlockHeaderTypeLeios: BlockTypeLeiosRanking,
3839
}
3940

4041
// BlockToBlockHeaderTypeMap is a mapping of NtC chainsync block types
4142
// to NtN block header types (era ID)
4243
var BlockToBlockHeaderTypeMap = map[uint]uint{
43-
BlockTypeShelley: BlockHeaderTypeShelley,
44-
BlockTypeAllegra: BlockHeaderTypeAllegra,
45-
BlockTypeMary: BlockHeaderTypeMary,
46-
BlockTypeAlonzo: BlockHeaderTypeAlonzo,
47-
BlockTypeBabbage: BlockHeaderTypeBabbage,
48-
BlockTypeConway: BlockHeaderTypeConway,
44+
BlockTypeShelley: BlockHeaderTypeShelley,
45+
BlockTypeAllegra: BlockHeaderTypeAllegra,
46+
BlockTypeMary: BlockHeaderTypeMary,
47+
BlockTypeAlonzo: BlockHeaderTypeAlonzo,
48+
BlockTypeBabbage: BlockHeaderTypeBabbage,
49+
BlockTypeConway: BlockHeaderTypeConway,
50+
BlockTypeLeiosRanking: BlockHeaderTypeLeios,
51+
BlockTypeLeiosEndorser: BlockHeaderTypeLeios,
4952
}

protocol/versions.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type ProtocolVersion struct {
3131
EnableAlonzoEra bool
3232
EnableBabbageEra bool
3333
EnableConwayEra bool
34+
EnableLeiosEra bool
3435
// NtC only
3536
EnableLocalQueryProtocol bool
3637
EnableLocalTxMonitorProtocol bool
@@ -161,8 +162,20 @@ var protocolVersions = map[uint16]ProtocolVersion{
161162
EnableConwayEra: true,
162163
EnableLocalTxMonitorProtocol: true,
163164
},
165+
// added additional Conway governance queries
166+
(20 + ProtocolVersionNtCOffset): {
167+
NewVersionDataFromCborFunc: NewVersionDataNtC15andUpFromCbor,
168+
EnableLocalQueryProtocol: true,
169+
EnableShelleyEra: true,
170+
EnableAllegraEra: true,
171+
EnableMaryEra: true,
172+
EnableAlonzoEra: true,
173+
EnableBabbageEra: true,
174+
EnableConwayEra: true,
175+
EnableLeiosEra: true,
176+
EnableLocalTxMonitorProtocol: true,
177+
},
164178

165-
// NtN versions
166179
//
167180
// We don't bother supporting NtN protocol versions before 7 (when Alonzo was enabled)
168181

@@ -251,6 +264,20 @@ var protocolVersions = map[uint16]ProtocolVersion{
251264
EnableFullDuplex: true,
252265
EnablePeerSharingProtocol: true,
253266
},
267+
// Enables Leios era
268+
15: {
269+
NewVersionDataFromCborFunc: NewVersionDataNtN13andUpFromCbor,
270+
EnableShelleyEra: true,
271+
EnableKeepAliveProtocol: true,
272+
EnableAllegraEra: true,
273+
EnableMaryEra: true,
274+
EnableAlonzoEra: true,
275+
EnableBabbageEra: true,
276+
EnableConwayEra: true,
277+
EnableLeiosEra: true,
278+
EnableFullDuplex: true,
279+
EnablePeerSharingProtocol: true,
280+
},
254281
}
255282

256283
// GetProtocolVersionMap returns a data structure suitable for use with the protocol handshake

0 commit comments

Comments
 (0)