|
| 1 | +# Qubic.Net Update Plan |
| 2 | + |
| 3 | +Run this checklist each time a new version of [qubic/core](https://github.com/qubic/core) is released. |
| 4 | + |
| 5 | +The C++ source is linked as a git submodule at `deps/qubic-core`. |
| 6 | + |
| 7 | +## 0. Update the submodule |
| 8 | + |
| 9 | +```bash |
| 10 | +cd deps/qubic-core |
| 11 | +git fetch origin |
| 12 | +git checkout <new-release-tag-or-commit> |
| 13 | +cd ../.. |
| 14 | +``` |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 1. Check version |
| 19 | + |
| 20 | +**C++ source:** `deps/qubic-core/src/public_settings.h` → `VERSION_A`, `VERSION_B`, `VERSION_C` |
| 21 | +**C# target:** `src/Qubic.Core/QubicConstants.cs` → `QubicCoreVersion` |
| 22 | +**C# target:** `src/Qubic.Core/Qubic.Core.csproj` → `<Version>` |
| 23 | + |
| 24 | +Update the version string and the doc comment at the top of `QubicConstants.cs`. |
| 25 | +The NuGet package version in `Qubic.Core.csproj` mirrors the core version (e.g., core `1.278.0` → package `1.278.0`). |
| 26 | +For C#-only bugfixes between core releases, use a 4th segment (e.g., `1.278.0.1`). |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## 2. Update constants |
| 31 | + |
| 32 | +**C++ source:** `deps/qubic-core/src/network_messages/common_def.h` |
| 33 | +**C# target:** `src/Qubic.Core/QubicConstants.cs` |
| 34 | + |
| 35 | +Check these values: |
| 36 | +- `NUMBER_OF_COMPUTORS` → `NumberOfComputors` |
| 37 | +- `QUORUM` → `Quorum` |
| 38 | +- `NUMBER_OF_EXCHANGED_PEERS` → `NumberOfExchangedPeers` |
| 39 | +- `SPECTRUM_DEPTH` → `SpectrumDepth` |
| 40 | +- `SPECTRUM_CAPACITY` → `SpectrumCapacity` |
| 41 | +- `ASSETS_DEPTH` → `AssetsDepth` |
| 42 | +- `ASSETS_CAPACITY` → `AssetsCapacity` |
| 43 | +- `NUMBER_OF_TRANSACTIONS_PER_TICK` → `MaxTransactionsPerTick` |
| 44 | +- `MAX_NUMBER_OF_CONTRACTS` → `MaxNumberOfContracts` |
| 45 | +- `MAX_INPUT_SIZE` → `MaxInputSize` |
| 46 | +- `SIGNATURE_SIZE` → `SignatureSize` |
| 47 | +- `ISSUANCE_RATE` → `IssuanceRate` |
| 48 | +- `MAX_AMOUNT` → `MaxAmount` |
| 49 | +- `MAX_SUPPLY` → `MaxSupply` |
| 50 | + |
| 51 | +Also check `deps/qubic-core/src/public_settings.h` for any new constants. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## 3. Update network message types |
| 56 | + |
| 57 | +**C++ source:** `deps/qubic-core/src/network_messages/network_message_type.h` → `enum NetworkMessageType` |
| 58 | +**C# target:** `src/Qubic.Core/NetworkMessageTypes.cs` |
| 59 | + |
| 60 | +Add any new message types, verify existing values haven't changed. |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## 4. Update contract definitions |
| 65 | + |
| 66 | +**C++ source:** `deps/qubic-core/src/contract_core/contract_def.h` → `contractDescriptions[]` array |
| 67 | +**C# target:** `src/Qubic.Core/QubicContracts.cs` |
| 68 | + |
| 69 | +For each contract entry verify index, name, and construction epoch. |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## 5. Update QX procedures |
| 74 | + |
| 75 | +**C++ source:** `deps/qubic-core/src/contracts/Qx.h` → `REGISTER_USER_PROCEDURES` macro |
| 76 | +**C# target:** `src/Qubic.Core/QxProcedures.cs` |
| 77 | + |
| 78 | +Each `REGISTER_USER_PROCEDURE(Name, ID)` maps to `public const ushort Name = ID;` |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## 6. Update QUTIL procedures |
| 83 | + |
| 84 | +**C++ source:** `deps/qubic-core/src/contracts/QUtil.h` → `REGISTER_USER_PROCEDURES` macro |
| 85 | +**C# target:** `src/Qubic.Core/QutilProcedures.cs` |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## 7. Check struct sizes |
| 90 | + |
| 91 | +If network structs changed, verify derived size constants in `QubicConstants.cs`: |
| 92 | +- `EntityRecordSize` (64) — `deps/qubic-core/src/network_messages/entity.h` |
| 93 | +- `TransactionHeaderSize` (80) — transaction struct |
| 94 | +- `TickSize` (344) — tick struct |
| 95 | +- `AssetRecordSize` (48) — asset structs |
| 96 | +- `PacketHeaderSize` (8) — `RequestResponseHeader` |
| 97 | + |
| 98 | +Also check if `Qubic.Serialization` readers/writers need updates. |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## 8. Build and test |
| 103 | + |
| 104 | +```bash |
| 105 | +dotnet build |
| 106 | +dotnet test |
| 107 | +``` |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## 9. Publish updated packages |
| 112 | + |
| 113 | +If `Qubic.Crypto` changed: |
| 114 | +1. Bump version in `src/Qubic.Crypto/Qubic.Crypto.csproj` |
| 115 | +2. `dotnet pack src/Qubic.Crypto -c Release` → publish to NuGet |
| 116 | +3. Update `PackageReference` version in `src/Qubic.Core/Qubic.Core.csproj` |
| 117 | + |
| 118 | +Then for `Qubic.Core`: |
| 119 | +1. Set version in `src/Qubic.Core/Qubic.Core.csproj` to match core (e.g., `1.279.0`) |
| 120 | +2. `dotnet pack src/Qubic.Core -c Release` → publish to NuGet |
| 121 | + |
| 122 | +--- |
| 123 | + |
| 124 | +## Quick reference: C++ → C# file mapping |
| 125 | + |
| 126 | +| C++ Source (deps/qubic-core/) | C# Target (src/Qubic.Core/) | |
| 127 | +|-------------------------------|------------------------------| |
| 128 | +| `src/public_settings.h` | `QubicConstants.cs` | |
| 129 | +| `src/network_messages/common_def.h` | `QubicConstants.cs` | |
| 130 | +| `src/network_messages/network_message_type.h` | `NetworkMessageTypes.cs` | |
| 131 | +| `src/contract_core/contract_def.h` | `QubicContracts.cs` | |
| 132 | +| `src/contracts/Qx.h` | `QxProcedures.cs` | |
| 133 | +| `src/contracts/QUtil.h` | `QutilProcedures.cs` | |
0 commit comments