Skip to content

Commit

Permalink
feat: Add Quebec parameters (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
huancheng-trili authored Jan 13, 2025
1 parent 3153325 commit b1b65ee
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 56 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v1.21.0
* Quebec protocol support

## v1.19.2
* Update Parisnet hash
* Update protocol history of ghostnet
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ TzGo's main focus is on **correctness**, **stability**, and **compliance** with

Current Tezos protocol support in TzGo

- Quebec v021
- ParisC v020
- Paris v019
- Oxford v018
- Nairobi v017
Expand Down
35 changes: 8 additions & 27 deletions tezos/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,32 @@ var (
// either overwrite this default or set custom params per operation using
// op.WithParams().
DefaultParams = (&Params{
MinimalBlockDelay: 10 * time.Second,
MinimalBlockDelay: 8 * time.Second,
CostPerByte: 250,
OriginationSize: 257,
HardGasLimitPerOperation: 1040000,
HardGasLimitPerBlock: 1733333,
HardGasLimitPerBlock: 1386666,
HardStorageLimitPerOperation: 60000,
MaxOperationDataLength: 32768,
MaxOperationsTTL: 360,
MaxOperationsTTL: 450,
}).
WithChainId(Mainnet).
WithDeployment(Deployments[Mainnet].AtProtocol(ProtoV019))
WithDeployment(Deployments[Mainnet].AtProtocol(ProtoV021))

// GhostnetParams defines the blockchain configuration for Ghostnet testnet.
// To produce compliant transactions, use these defaults in op.WithParams().
GhostnetParams = (&Params{
MinimalBlockDelay: 8 * time.Second,
MinimalBlockDelay: 4 * time.Second,
CostPerByte: 250,
OriginationSize: 257,
HardGasLimitPerOperation: 1040000,
HardGasLimitPerBlock: 1733333,
HardGasLimitPerBlock: 1386666,
HardStorageLimitPerOperation: 60000,
MaxOperationDataLength: 32768,
MaxOperationsTTL: 360,
MaxOperationsTTL: 450,
}).
WithChainId(Ghostnet).
WithDeployment(Deployments[Ghostnet].AtProtocol(ProtoV019))

// ParisnetParams defines the blockchain configuration for Paris testnet.
// To produce compliant transactions, use these defaults in op.WithParams().
ParisnetParams = (&Params{
MinimalBlockDelay: 5 * time.Second,
CostPerByte: 250,
OriginationSize: 257,
HardGasLimitPerOperation: 1040000,
HardGasLimitPerBlock: 1733333,
HardStorageLimitPerOperation: 60000,
MaxOperationDataLength: 32768,
MaxOperationsTTL: 360,
}).
WithChainId(Parisnet).
WithDeployment(Deployments[Parisnet].AtProtocol(ProtoV019))
WithDeployment(Deployments[Ghostnet].AtProtocol(ProtoV021))
)

// Params contains a subset of protocol configuration settings that are relevant
Expand Down Expand Up @@ -111,10 +96,6 @@ func (p *Params) WithChainId(id ChainIdHash) *Params {
p.Network = "Mainnet"
case Ghostnet:
p.Network = "Ghostnet"
case Parisnet:
p.Network = "Parisnet"
case ParisCnet:
p.Network = "ParisCnet"
}
}
return p
Expand Down
50 changes: 21 additions & 29 deletions tezos/protocols.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
ProtoV018 = MustParseProtocolHash("ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH")
ProtoV019 = MustParseProtocolHash("PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ")
ProtoV020 = MustParseProtocolHash("PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi")
ProtoV021 = MustParseProtocolHash("PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg")

// aliases
PtAthens = ProtoV004
Expand All @@ -48,11 +49,10 @@ var (
Proxford = ProtoV018
PtParisB = ProtoV019
PsParisC = ProtoV020
PsQuebec = ProtoV021

Mainnet = MustParseChainIdHash("NetXdQprcVkpaWU")
Ghostnet = MustParseChainIdHash("NetXnHfVqm9iesp")
Parisnet = MustParseChainIdHash("NetXR64bNAYkP4S")
ParisCnet = MustParseChainIdHash("NetXXWAHLEvre9b")
Mainnet = MustParseChainIdHash("NetXdQprcVkpaWU")
Ghostnet = MustParseChainIdHash("NetXnHfVqm9iesp")

versionsMtx = sync.RWMutex{}
Versions = map[ProtocolHash]int{
Expand All @@ -78,7 +78,8 @@ var (
ProtoV018: 18,
ProtoV019: 19,
ProtoV020: 20,
ProtoAlpha: 21,
ProtoV021: 21,
ProtoAlpha: 22,
}

Deployments = map[ChainIdHash]ProtocolHistory{
Expand All @@ -104,32 +105,23 @@ var (
{PtNairobi, 0, 3760129, 5070848, 623, 5, 16384, 1024}, // v17
{Proxford, 0, 5070849, 5726208, 703, 5, 16384, 1024}, // v18
{PtParisB, 0, 5726209, 5898240, 743, 2, 24576, 24576}, // v19
{PsParisC, 0, 5898241, -1, 750, 2, 24576, 24576}, // v19
{PsParisC, 0, 5898241, 7692288, 750, 2, 24576, 24576}, // v20
{PsQuebec, 0, 7692289, -1, 823, 2, 30720, 30720}, // v21
},
Ghostnet: {
{ProtoGenesis, 0, 0, 0, 0, 3, 4096, 256}, // 0
{ProtoBootstrap, 0, 1, 1, 0, 3, 4096, 256}, // 0
{PtHangz2, 2, 2, 8191, 0, 3, 4096, 256}, // v11
{Psithaca, 0, 8192, 765952, 2, 3, 4096, 256}, // v12
{PtJakart, 0, 765953, 1191936, 187, 3, 4096, 256}, // v13
{PtKathma, 0, 1191937, 1654784, 291, 3, 4096, 256}, // v14
{PtLimaPt, 0, 1654785, 2162688, 404, 3, 4096, 256}, // v15
{PtMumbai, 0, 2162689, 2957312, 528, 3, 8192, 512}, // v16
{PtNairobi, 0, 2957313, 5316608, 625, 3, 8192, 512}, // v17
{Proxford, 0, 5316609, 6422528, 913, 3, 8192, 512}, // v18
{PtParisB, 0, 6422529, 6729728, 1048, 2, 12288, 12288}, // v19
{PsParisC, 0, 6729729, -1, 1073, 2, 12288, 12288}, // v19
},
Parisnet: {
{ProtoGenesis, 0, 0, 0, 0, 3, 8192, 512}, // 0
{ProtoBootstrap, 0, 1, 1, 0, 3, 8192, 512}, // 0
{Proxford, 2, 2, 8192, 0, 3, 8192, 512}, // v18
{PtParisB, 0, 8193, -1, 1, 2, 12288, 12288}, // v19
},
ParisCnet: {
{ProtoGenesis, 0, 0, 0, 0, 3, 8192, 512}, // 0
{ProtoBootstrap, 0, 1, 1, 0, 3, 8192, 512}, // 0
{PsParisC, 2, 2, -1, 0, 2, 128, 128}, // v19
{ProtoGenesis, 0, 0, 0, 0, 3, 4096, 256}, // 0
{ProtoBootstrap, 0, 1, 1, 0, 3, 4096, 256}, // 0
{PtHangz2, 2, 2, 8191, 0, 3, 4096, 256}, // v11
{Psithaca, 0, 8192, 765952, 2, 3, 4096, 256}, // v12
{PtJakart, 0, 765953, 1191936, 187, 3, 4096, 256}, // v13
{PtKathma, 0, 1191937, 1654784, 291, 3, 4096, 256}, // v14
{PtLimaPt, 0, 1654785, 2162688, 404, 3, 4096, 256}, // v15
{PtMumbai, 0, 2162689, 2957312, 528, 3, 8192, 512}, // v16
{PtNairobi, 0, 2957313, 5316608, 625, 3, 8192, 512}, // v17
{Proxford, 0, 5316609, 6422528, 913, 3, 8192, 512}, // v18
{PtParisB, 0, 6422529, 6729728, 1048, 2, 12288, 12288}, // v19
{PsParisC, 0, 6729729, 10047488, 1073, 2, 12288, 12288}, // v20
{PsQuebec, 0, 10047489, -1, 1343, 2, 15360, 15360}, // v21
},
}
)
Expand Down

0 comments on commit b1b65ee

Please sign in to comment.