diff --git a/Tzkt.Api/Models/Protocol.cs b/Tzkt.Api/Models/Protocol.cs index 3e66ffc4..5263307b 100644 --- a/Tzkt.Api/Models/Protocol.cs +++ b/Tzkt.Api/Models/Protocol.cs @@ -14,6 +14,11 @@ public class Protocol /// public string Hash { get; set; } + /// + /// Global version number + /// + public int Version { get; set; } + /// /// Block height where the protocol was applied /// diff --git a/Tzkt.Api/Repositories/ProtocolRepository.cs b/Tzkt.Api/Repositories/ProtocolRepository.cs index 30c453ce..d09a5edb 100644 --- a/Tzkt.Api/Repositories/ProtocolRepository.cs +++ b/Tzkt.Api/Repositories/ProtocolRepository.cs @@ -37,6 +37,7 @@ ORDER BY ""FirstLevel"" DESC { Code = row.Code, Hash = row.Hash, + Version = row.Version, FirstLevel = row.FirstLevel, FirstCycle = row.FirstCycle, FirstCycleLevel = row.FirstCycleLevel, @@ -105,6 +106,7 @@ public async Task Get(int code) { Code = code, Hash = row.Hash, + Version = row.Version, FirstLevel = row.FirstLevel, FirstCycle = row.FirstCycle, FirstCycleLevel = row.FirstCycleLevel, @@ -173,6 +175,7 @@ public async Task Get(string hash) { Code = row.Code, Hash = hash, + Version = row.Version, FirstLevel = row.FirstLevel, FirstCycle = row.FirstCycle, FirstCycleLevel = row.FirstCycleLevel, @@ -242,6 +245,7 @@ public async Task> Get(SortParameter sort, OffsetParameter { Code = row.Code, Hash = row.Hash, + Version = row.Version, FirstLevel = row.FirstLevel, FirstCycle = row.FirstCycle, FirstCycleLevel = row.FirstCycleLevel, diff --git a/Tzkt.Sync/Protocols/Handlers/Proto19/Activation/ProtoActivator.cs b/Tzkt.Sync/Protocols/Handlers/Proto19/Activation/ProtoActivator.cs index 8f9bcb74..976128c7 100644 --- a/Tzkt.Sync/Protocols/Handlers/Proto19/Activation/ProtoActivator.cs +++ b/Tzkt.Sync/Protocols/Handlers/Proto19/Activation/ProtoActivator.cs @@ -30,6 +30,9 @@ protected override void UpgradeParameters(Protocol protocol, Protocol prev) protocol.BlocksPerVoting = protocol.BlocksPerVoting * 3 / 2; protocol.TimeBetweenBlocks = protocol.TimeBetweenBlocks * 2 / 3; protocol.HardBlockGasLimit = prev.HardBlockGasLimit * 2 / 3; + protocol.SmartRollupCommitmentPeriod = 15 * 60 / protocol.TimeBetweenBlocks; + protocol.SmartRollupChallengeWindow = 14 * 24 * 60 * 60 / protocol.TimeBetweenBlocks; + protocol.SmartRollupTimeoutPeriod = 7 * 24 * 60 * 60 / protocol.TimeBetweenBlocks; } protected override async Task MigrateContext(AppState state)