Skip to content

Commit 6f0e662

Browse files
committed
Add correct deployment info for City Chain
- Rename the City.csproj to Blockcore.Networks.City to reflect pattern as other projects.
1 parent cb5d61b commit 6f0e662

8 files changed

Lines changed: 71 additions & 57 deletions

File tree

src/Blockcore.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blockcore.IntegrationTests.
104104
EndProject
105105
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "City", "City", "{3AD23CD3-51A4-4DFE-9501-55963B54519A}"
106106
EndProject
107-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "City", "Networks\City\City\City.csproj", "{C4D5381C-53D0-419A-A32B-70E38C5A42A4}"
107+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blockcore.Networks.City", "Networks\City\City\Blockcore.Networks.City.csproj", "{C4D5381C-53D0-419A-A32B-70E38C5A42A4}"
108108
EndProject
109109
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "City.Node", "Networks\City\City.Node\City.Node.csproj", "{363B09A7-BA71-4BC2-ABCA-B47065C374E5}"
110110
EndProject

src/Networks/City/City.Node/City.Node.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<ProjectReference Include="..\City\City.csproj" />
29+
<ProjectReference Include="..\City\Blockcore.Networks.City.csproj" />
3030
</ItemGroup>
3131
</Project>
File renamed without changes.

src/Networks/City/City/Networks/CityMain.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using City.Networks.Consensus;
1717
using City.Networks.Setup;
1818
using NBitcoin.Protocol;
19+
using City.Networks.Deployments;
1920

2021
namespace City.Networks
2122
{
@@ -82,6 +83,14 @@ public CityMain()
8283
[BuriedDeployments.BIP66] = 0
8384
};
8485

86+
var bip9Deployments = new CityBIP9Deployments()
87+
{
88+
[CityBIP9Deployments.ColdStaking] = new BIP9DeploymentsParameters("ColdStaking", 2,
89+
new DateTime(2018, 12, 1, 0, 0, 0, DateTimeKind.Utc),
90+
new DateTime(2019, 12, 1, 0, 0, 0, DateTimeKind.Utc),
91+
BIP9DeploymentsParameters.DefaultMainnetThreshold)
92+
};
93+
8594
consensusFactory.Protocol = new ConsensusProtocol()
8695
{
8796
ProtocolVersion = ProtocolVersion.FEEFILTER_VERSION,
@@ -98,7 +107,7 @@ public CityMain()
98107
majorityRejectBlockOutdated: 950,
99108
majorityWindow: 1000,
100109
buriedDeployments: buriedDeployments,
101-
bip9Deployments: new NoBIP9Deployments(),
110+
bip9Deployments: bip9Deployments,
102111
bip34Hash: null,
103112
minerConfirmationWindow: 2016, // nPowTargetTimespan / nPowTargetSpacing
104113
maxReorgLength: 500,

src/Networks/City/City/Networks/CityRegTest.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Linq;
33
using System.Net;
44
using City.Networks.Consensus;
5+
using City.Networks.Deployments;
56
using City.Networks.Policies;
67
using City.Networks.Setup;
78
using NBitcoin;
@@ -65,6 +66,14 @@ public CityRegTest()
6566
[BuriedDeployments.BIP66] = 0
6667
};
6768

69+
var bip9Deployments = new CityBIP9Deployments()
70+
{
71+
[CityBIP9Deployments.ColdStaking] = new BIP9DeploymentsParameters("ColdStaking", 2,
72+
new DateTime(2018, 12, 1, 0, 0, 0, DateTimeKind.Utc),
73+
new DateTime(2019, 12, 1, 0, 0, 0, DateTimeKind.Utc),
74+
BIP9DeploymentsParameters.DefaultMainnetThreshold)
75+
};
76+
6877
consensusFactory.Protocol = new ConsensusProtocol()
6978
{
7079
ProtocolVersion = ProtocolVersion.FEEFILTER_VERSION,
@@ -81,7 +90,7 @@ public CityRegTest()
8190
majorityRejectBlockOutdated: 950,
8291
majorityWindow: 1000,
8392
buriedDeployments: buriedDeployments,
84-
bip9Deployments: new NoBIP9Deployments(),
93+
bip9Deployments: bip9Deployments,
8594
bip34Hash: null,
8695
minerConfirmationWindow: 2016, // nPowTargetTimespan / nPowTargetSpacing
8796
maxReorgLength: 500,

src/Networks/City/City/Networks/CityTest.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Linq;
33
using System.Net;
44
using City.Networks.Consensus;
5+
using City.Networks.Deployments;
56
using City.Networks.Policies;
67
using City.Networks.Setup;
78
using NBitcoin;
@@ -65,6 +66,14 @@ public CityTest()
6566
[BuriedDeployments.BIP66] = 0
6667
};
6768

69+
var bip9Deployments = new CityBIP9Deployments()
70+
{
71+
[CityBIP9Deployments.ColdStaking] = new BIP9DeploymentsParameters("ColdStaking", 2,
72+
new DateTime(2018, 12, 1, 0, 0, 0, DateTimeKind.Utc),
73+
new DateTime(2019, 12, 1, 0, 0, 0, DateTimeKind.Utc),
74+
BIP9DeploymentsParameters.DefaultMainnetThreshold)
75+
};
76+
6877
consensusFactory.Protocol = new ConsensusProtocol()
6978
{
7079
ProtocolVersion = ProtocolVersion.FEEFILTER_VERSION,
@@ -81,7 +90,7 @@ public CityTest()
8190
majorityRejectBlockOutdated: 950,
8291
majorityWindow: 1000,
8392
buriedDeployments: buriedDeployments,
84-
bip9Deployments: new NoBIP9Deployments(),
93+
bip9Deployments: bip9Deployments,
8594
bip34Hash: null,
8695
minerConfirmationWindow: 2016, // nPowTargetTimespan / nPowTargetSpacing
8796
maxReorgLength: 500,

src/Networks/City/City/Networks/Deployments/CityBIP9Deployments.cs

Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,42 @@
22

33
namespace City.Networks.Deployments
44
{
5-
/// <summary>
6-
/// BIP9 deployments for the Blockcore sample coin network.
7-
/// </summary>
8-
public class CityBIP9Deployments : BIP9DeploymentsArray
9-
{
10-
// The position of each deployment in the deployments array. Note that this is decoupled from the actual position of the flag bit for the deployment in the block version.
11-
public const int TestDummy = 0;
12-
public const int CSV = 1;
13-
public const int Segwit = 2;
14-
public const int ColdStaking = 3;
15-
16-
// The number of deployments.
17-
public const int NumberOfDeployments = 4;
18-
19-
/// <summary>
20-
/// Constructs the BIP9 deployments array.
21-
/// </summary>
22-
public CityBIP9Deployments() : base(NumberOfDeployments)
23-
{
24-
}
25-
26-
/// <summary>
27-
/// Gets the deployment flags to set when the deployment activates.
28-
/// </summary>
29-
/// <param name="deployment">The deployment number.</param>
30-
/// <returns>The deployment flags.</returns>
31-
public override BIP9DeploymentFlags GetFlags(int deployment)
32-
{
33-
var flags = new BIP9DeploymentFlags();
34-
35-
switch (deployment)
36-
{
37-
case ColdStaking:
38-
flags.ScriptFlags |= ScriptVerify.CheckColdStakeVerify;
39-
break;
40-
41-
case CSV:
42-
// Start enforcing BIP68 (sequence locks), BIP112 (CHECKSEQUENCEVERIFY) and BIP113 (Median Time Past) using versionbits logic.
43-
flags.ScriptFlags = ScriptVerify.CheckSequenceVerify;
44-
flags.LockTimeFlags = Transaction.LockTimeFlags.VerifySequence | Transaction.LockTimeFlags.MedianTimePast;
45-
break;
46-
47-
case Segwit:
48-
// Start enforcing WITNESS rules using versionbits logic.
49-
flags.ScriptFlags = ScriptVerify.Witness;
50-
break;
51-
}
52-
53-
return flags;
54-
}
55-
}
5+
/// <summary>
6+
/// BIP9 deployments for the Blockcore sample coin network.
7+
/// </summary>
8+
public class CityBIP9Deployments : BIP9DeploymentsArray
9+
{
10+
// The position of each deployment in the deployments array. Note that this is decoupled from the actual position of the flag bit for the deployment in the block version.
11+
public const int TestDummy = 0;
12+
public const int ColdStaking = 2;
13+
14+
// The number of deployments.
15+
public const int NumberOfDeployments = ColdStaking + 1;
16+
17+
/// <summary>
18+
/// Constructs the BIP9 deployments array.
19+
/// </summary>
20+
public CityBIP9Deployments() : base(NumberOfDeployments)
21+
{
22+
}
23+
24+
/// <summary>
25+
/// Gets the deployment flags to set when the deployment activates.
26+
/// </summary>
27+
/// <param name="deployment">The deployment number.</param>
28+
/// <returns>The deployment flags.</returns>
29+
public override BIP9DeploymentFlags GetFlags(int deployment)
30+
{
31+
var flags = new BIP9DeploymentFlags();
32+
33+
switch (deployment)
34+
{
35+
case ColdStaking:
36+
flags.ScriptFlags |= ScriptVerify.CheckColdStakeVerify;
37+
break;
38+
}
39+
40+
return flags;
41+
}
42+
}
5643
}

src/Node/Blockcore.Node/Blockcore.Node.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<ProjectReference Include="..\..\Networks\Bitcoin\Blockcore.Networks.Bitcoin\Blockcore.Networks.Bitcoin.csproj" />
15-
<ProjectReference Include="..\..\Networks\City\City\City.csproj" />
15+
<ProjectReference Include="..\..\Networks\City\City\Blockcore.Networks.City.csproj" />
1616
<ProjectReference Include="..\..\Networks\Stratis\Blockcore.Networks.Stratis\Blockcore.Networks.Stratis.csproj" />
1717
<ProjectReference Include="..\..\Networks\x42\x42\x42.Networks.csproj" />
1818
<ProjectReference Include="..\..\Networks\Xds\Blockcore.Networks.Xds\Blockcore.Networks.Xds.csproj" />

0 commit comments

Comments
 (0)