Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f1a6719
Add QubicSolanaBridge smart contract (QSB, index 27)
SoufianeBenbah Mar 26, 2026
7fb40ba
fix: resolve qubic sc compliance violations in QSBOrderMessage
YazhuEth Apr 9, 2026
8621ece
Enable local testnet bootstrap support
jean-michelet May 12, 2026
afa3e71
feat(contract): register QSB at index 28 with constructionEpoch=212 t…
jean-michelet May 13, 2026
afb0b80
feat(testnet): enable TESTNET_PREFILL_QUS and seed local test identities
jean-michelet May 13, 2026
605ea48
fix(testnet): prevent epoch transitions from breaking single-node tes…
jean-michelet May 20, 2026
cec2531
feat(testnet): fund jean wallet and reduce epoch duration
jean-michelet May 21, 2026
b8b5547
fix: add contract to cmake list
jean-michelet May 28, 2026
48fdfc7
test(qsb): fix admin bootstrap and add struct size diagnostics
jean-michelet May 28, 2026
2839690
fix(qsb): restrict Unpause to admin only
jean-michelet May 28, 2026
b61cc6b
fix(qsb): reject TransferAdmin to NULL_ID
jean-michelet May 28, 2026
95bace9
fix(qsb): surface silent failures in AddRole and OverrideLock
jean-michelet May 28, 2026
551b444
feat(qsb): double-buffer replay protection with era grace window
jean-michelet May 28, 2026
8fa1db2
chore(qsb): remove ineffective per-file alignment sanitizer suppression
jean-michelet May 28, 2026
fdf7c2a
chore(qsb): remove dead clearLockedOrderEntry and fix test helpers
jean-michelet Jun 1, 2026
65c7a1d
feat(qsb): return locked/filled orders most-recent-first
jean-michelet Jun 3, 2026
3e8dd40
fix(qsb): correct TestLock_RingBufferOverwritesOldestSlot assertions
jean-michelet Jun 3, 2026
14136d4
fix: extend testnet epoch rollover
jean-michelet Jun 5, 2026
9c355b1
revert: keep testnet rollover change in settings only
jean-michelet Jun 5, 2026
65ea3f9
Merge upstream main into feat/qubic-solana-smart-contract
jean-michelet Jun 5, 2026
d6d84aa
feat: add GGWP contract at index 28, shift QSB to index 29
jean-michelet Jun 8, 2026
479cc2d
feat: limit QSB overrideLock to 3 attempts per order
jean-michelet Jun 8, 2026
216deb7
fix: cap Unlock_input signature array to fit 1024-byte limit; documen…
jean-michelet Jun 8, 2026
6e4b54c
feat(qsb): per-admin proposal cap + clean unreachable guards in execu…
jean-michelet Jun 10, 2026
741461d
refactor(QSB): extract try* helpers, remove dummy params, single log …
jean-michelet Jun 10, 2026
80ed7e2
refactor(QSB): reorder sections — private helpers after public proced…
jean-michelet Jun 10, 2026
771eafa
refactor(QSB): remove trivial comments throughout contract
jean-michelet Jun 10, 2026
f85487d
revert: restore NUMBER_OF_TRANSACTIONS_PER_TICK to 1024
jean-michelet Jun 10, 2026
83bbf74
feat(QSB): multisig governance — real admin keys, testnet constructio…
jean-michelet Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ x64/
.clang-format
tmp
build/
build-test/
/build**

# Build directories and temporary files
Expand All @@ -31,4 +32,4 @@ CLAUDE.md

# Explorer embedded assets (generated by regen.sh at build)
src/extensions/http/controller/explorer_assets.generated.h
crash.dump
crash.dump
53 changes: 53 additions & 0 deletions README_CLANG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,56 @@ For a example compilation execute the following commands:
```

The output binary will be located at `build/src`

## Running Tests

### Configure (once)

Use a dedicated build directory to avoid mixing test and release artifacts:

```bash
cd /path/to/core-lite

cmake -S . -B build-test \
-DCMAKE_CXX_COMPILER=clang-18 \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
-DBUILD_BINARY=OFF \
-DUSE_SANITIZER=OFF
```

### Compile

```bash
cmake --build build-test --target qubic_core_tests -j$(nproc)
```

> **Known linker issue on Ubuntu (clang-18 + GCC stdlib mix):**
> The link step may fail with `undefined reference to '__cxa_pure_virtual'` or
> `vtable for __cxxabiv1::...`. Work around it by appending `-lc++abi -lstdc++`
> manually after compilation completes:
>
> ```bash
> cd build-test/test
> eval "$(cat CMakeFiles/qubic_core_tests.dir/link.txt) -lc++abi -lstdc++"
> ```
>
> Prerequisites: `sudo apt install libc++abi-dev libstdc++-12-dev`

### Run all tests

```bash
./build-test/test/qubic_core_tests
```

### Run QSB contract tests only

```bash
./build-test/test/qubic_core_tests --gtest_filter="ContractTestingQSB*"
```

### Run a single test

```bash
./build-test/test/qubic_core_tests --gtest_filter="ContractTestingQSB.TestOverrideLock_BlockedAfterMaxAttempts"
```
1 change: 0 additions & 1 deletion docker/orchestrator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ RUN rm -rf build \
-D BUILD_BINARY:BOOL=ON \
-D CMAKE_BUILD_TYPE=Release \
-D ENABLE_AVX512=OFF \
-D ONLY_LOGGING=ON \
&& cmake --build . --target Qubic -- -j$(nproc)

# Collect build outputs into a common location
Expand Down
1 change: 1 addition & 0 deletions src/Qubic.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<ClInclude Include="contracts\Qusino.h" />
<ClInclude Include="contracts\QReservePool.h" />
<ClInclude Include="contracts\QThirtyFour.h" />
<ClInclude Include="contracts\QubicSolanaBridge.h" />
<ClInclude Include="contracts\Pulse.h" />
<ClInclude Include="contracts\Escrow.h" />
<ClInclude Include="contracts\GGWP.h" />
Expand Down
4 changes: 4 additions & 0 deletions src/Qubic.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@
<ClInclude Include="contracts\QDuel.h">
<Filter>contracts</Filter>
</ClInclude>

<ClInclude Include="contracts\QubicSolanaBridge.h">
<Filter>contracts</Filter>
</ClInclude>
<ClInclude Include="contracts\Pulse.h">
<Filter>contracts</Filter>
</ClInclude>
Expand Down
70 changes: 37 additions & 33 deletions src/contract_core/contract_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,25 +282,31 @@
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#define ESCROW_CONTRACT_INDEX 27
#define CONTRACT_INDEX ESCROW_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE ESCROW
#define CONTRACT_STATE2_TYPE ESCROW2
#include "contracts/Escrow.h"

#ifndef NO_GGWP

#undef CONTRACT_INDEX
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#define WOLFPACK_CONTRACT_INDEX 28
#define CONTRACT_INDEX WOLFPACK_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE WOLFPACK
#define CONTRACT_STATE2_TYPE WOLFPACK2
#include "contracts/GGWP.h"

#endif
#define ESCROW_CONTRACT_INDEX 27
#define CONTRACT_INDEX ESCROW_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE ESCROW
#define CONTRACT_STATE2_TYPE ESCROW2
#include "contracts/Escrow.h"

#undef CONTRACT_INDEX
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#define WOLFPACK_CONTRACT_INDEX 28
#define CONTRACT_INDEX WOLFPACK_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE WOLFPACK
#define CONTRACT_STATE2_TYPE WOLFPACK2
#include "contracts/GGWP.h"

#undef CONTRACT_INDEX
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#define QSB_CONTRACT_INDEX 29
#define CONTRACT_INDEX QSB_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE QSB
#define CONTRACT_STATE2_TYPE QSB2
#include "contracts/QubicSolanaBridge.h"

// new contracts should be added above this line

Expand Down Expand Up @@ -413,13 +419,12 @@ constexpr struct ContractDescription
{"QTF", 199, 10000, sizeof(QTF::StateData)}, // proposal in epoch 197, IPO in 198, construction and first use in 199
{"QDUEL", 199, 10000, sizeof(QDUEL::StateData)}, // proposal in epoch 197, IPO in 198, construction and first use in 199
{"PULSE", 204, 10000, sizeof(PULSE::StateData)}, // proposal in epoch 202, IPO in 203, construction and first use in 204
{"VOTTUN", 206, 10000, sizeof(VOTTUNBRIDGE::StateData)}, // proposal in epoch 204, IPO in 205, construction and first use in 206
{"QUSINO", 208, 10000, sizeof(QUSINO::StateData)}, // proposal in epoch 206, IPO in 207, construction and first use in 208
{"ESCROW", 210, 10000, sizeof(ESCROW::StateData)}, // proposal in epoch 208, IPO in 209, construction and first use in 210
#ifndef NO_GGWP
{"GGWP", 217, 10000, sizeof(WOLFPACK::StateData)}, // proposal in epoch 215, IPO in 216, construction and first use in 217
#endif
// new contracts should be added above this line
{"VOTTUN", 206, 10000, sizeof(VOTTUNBRIDGE::StateData)}, // proposal in epoch 204, IPO in 205, construction and first use in 206
{"QUSINO", 208, 10000, sizeof(QUSINO::StateData)}, // proposal in epoch 206, IPO in 207, construction and first use in 208
{"ESCROW", 210, 10000, sizeof(ESCROW::StateData)}, // proposal in epoch 208, IPO in 209, construction and first use in 210
{"GGWP", 217, 10000, sizeof(WOLFPACK::StateData)}, // proposal in epoch 215, IPO in 216, construction and first use in 217
{"QSB", 216, 10000, sizeof(QSB::StateData)}, // local testnet: align constructionEpoch with current testnet epoch so INITIALIZE runs on clean reset
// new contracts should be added above this line
#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
{"TESTEXA", 138, 10000, sizeof(TESTEXA::StateData)},
{"TESTEXB", 138, 10000, sizeof(TESTEXB::StateData)},
Expand Down Expand Up @@ -539,13 +544,12 @@ static void initializeContracts()
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QTF);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QDUEL);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(PULSE);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(VOTTUNBRIDGE);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QUSINO);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(ESCROW);
#ifndef NO_GGWP
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(WOLFPACK);
#endif
// new contracts should be added above this line
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(VOTTUNBRIDGE);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QUSINO);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(ESCROW);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(WOLFPACK);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QSB);
// new contracts should be added above this line
#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(TESTEXA);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(TESTEXB);
Expand Down
Loading