Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

Commit 437be70

Browse files
hackerby888Franziska-MuellerTakaYuPPcyber-pckrypdkat
authored
merge new changes (#10)
* Verify SC files automatically (qubic#506) * compliance changes for CCF SC * compliance changes for GQMPROP SC * compliance changes for MSVAULT SC * compliance changes for QEARN SC * compliance changes for QBAY SC * compliance changes for QUOTTERY SC * compliance changes for QUTIL SC * compliance changes for QX SC * Qx: add div type explicitly to fix compile errors in test project * compliance changes for TestExampleD SC * add contract verify workflow * Update contract-verify.yml * update branch name in contract-verify.yml * find all contract files to verify * fix typo in contract-verify.yml * print full path to file list * use list of contract files as input for verify action * only trigger contract-verify.yml when contract files or workflow file changed * use published action in contract-verify.yml * Revert "use published action in contract-verify.yml" This reverts commit 6fbd535. * mention contract verification tool in contracts.md * make QPI div and mod constexpr * update contract verify tool text in contracts.md * add STATIC_ASSERT macro to enable use of static asserts in SC files * remove workflow trigger on feature branch before merging into develop * contributing doc: add paragraph about curly braces style * update contract guidelines (qubic#512) * remove unused defines that clash with QPI definitions * fix: fixed gtest bug in qearn (qubic#516) * fix: fixed gtest bug in qearn * fix: removed unnecessary local variables in BEGIN_EPOCH procedure * update contract verify tool to v0.3.3-beta * Fix incorrect vc optimization of FourQ for release mode. (qubic#517) * Add unittest for fourq. * Fix MSVC misoptimization causing incorrect operation ordering. * Unittest: Ensure FourQ is initialized if signature verification is used in contract testing. * Add comment for optimization bug of MSVC. * networking: support private IPs (qubic#513) * nw: support private IPs * remove redundant code * fix warning * add checking boundary when accessing publicPeers * Fix bug relate to invalid mining seed of qpi mining. (qubic#518) * update params for epoch 176 / v1.257.0 * Remove mining seed set function in qpi. * Increase target tick duration The delay function did not work due to bugs. Now the delay function works and tick time should decrease. * Develop (#4) * Verify SC files automatically (qubic#506) * compliance changes for CCF SC * compliance changes for GQMPROP SC * compliance changes for MSVAULT SC * compliance changes for QEARN SC * compliance changes for QBAY SC * compliance changes for QUOTTERY SC * compliance changes for QUTIL SC * compliance changes for QX SC * Qx: add div type explicitly to fix compile errors in test project * compliance changes for TestExampleD SC * add contract verify workflow * Update contract-verify.yml * update branch name in contract-verify.yml * find all contract files to verify * fix typo in contract-verify.yml * print full path to file list * use list of contract files as input for verify action * only trigger contract-verify.yml when contract files or workflow file changed * use published action in contract-verify.yml * Revert "use published action in contract-verify.yml" This reverts commit 6fbd535. * mention contract verification tool in contracts.md * make QPI div and mod constexpr * update contract verify tool text in contracts.md * add STATIC_ASSERT macro to enable use of static asserts in SC files * remove workflow trigger on feature branch before merging into develop * contributing doc: add paragraph about curly braces style * update contract guidelines (qubic#512) * remove unused defines that clash with QPI definitions * fix: fixed gtest bug in qearn (qubic#516) * fix: fixed gtest bug in qearn * fix: removed unnecessary local variables in BEGIN_EPOCH procedure * update contract verify tool to v0.3.3-beta * Fix incorrect vc optimization of FourQ for release mode. (qubic#517) * Add unittest for fourq. * Fix MSVC misoptimization causing incorrect operation ordering. * Unittest: Ensure FourQ is initialized if signature verification is used in contract testing. * Add comment for optimization bug of MSVC. * networking: support private IPs (qubic#513) * nw: support private IPs * remove redundant code * fix warning * add checking boundary when accessing publicPeers * Fix bug relate to invalid mining seed of qpi mining. (qubic#518) * update params for epoch 176 / v1.257.0 * Increase target tick duration The delay function did not work due to bugs. Now the delay function works and tick time should decrease. --------- Co-authored-by: Franziska Mueller <11660876+Franziska-Mueller@users.noreply.github.com> Co-authored-by: TakaYuPP <yutotaka24@gmail.com> Co-authored-by: cyber-pc <165458555+cyber-pc@users.noreply.github.com> Co-authored-by: dkat <39078779+krypdkat@users.noreply.github.com> Co-authored-by: fnordspace <qubic@fnord.space> * Fix bug in PRIVATE_PEER_IP logic * update params for epoch 176 / v1.257.1 * fix a merge bug * fix not ticking bug * faster tick time in testnet * fix contract test failed * Update README.md * initial linux port * pin main thread for windows * fix atomic bugs * fix compilation bugs in windows * update cmake build parameter * Revise README_CLANG.md for clarity and accuracy * Enhance README with build instructions and details * Update README_CLANG.md with installation commands Added compiler installation commands to README_CLANG.md. * Update README.md * linux port (#7) * initial linux port * pin main thread for windows * fix atomic bugs * fix compilation bugs in windows * update cmake build parameter * Revise README_CLANG.md for clarity and accuracy * Enhance README with build instructions and details * Update README_CLANG.md with installation commands Added compiler installation commands to README_CLANG.md. * Update README.md * Format README.md for improved readability * Revise compiler installation commands in README Updated installation commands for clarity and added missing packages. * performance boost * improve networking performance * fix compilation bugs in windows * fix misalign bug in linux * fix networking bugs (#9) * tmp fix * fixed bug cause new incomming connection get rejected * upgrade stimulate uefi networking behaviour * boost main thread performance in msvc * log tick digest * fix hangling send() * improve send() behaviour in linux * correctly enable non-blocking mode in windows * remove unused logs --------- Co-authored-by: Franziska Mueller <11660876+Franziska-Mueller@users.noreply.github.com> Co-authored-by: TakaYuPP <yutotaka24@gmail.com> Co-authored-by: cyber-pc <165458555+cyber-pc@users.noreply.github.com> Co-authored-by: dkat <39078779+krypdkat@users.noreply.github.com> Co-authored-by: fnordspace <qubic@fnord.space>
1 parent 33156d0 commit 437be70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1455
-544
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: ContractVerify
7+
8+
on:
9+
push:
10+
branches: [ "main", "develop" ]
11+
paths:
12+
- 'src/contracts/*.h'
13+
- '.github/workflows/contract-verify.yml'
14+
pull_request:
15+
branches: [ "main", "develop" ]
16+
paths:
17+
- 'src/contracts/*.h'
18+
- '.github/workflows/contract-verify.yml'
19+
20+
jobs:
21+
contract_verify_job:
22+
runs-on: ubuntu-latest
23+
name: Verify smart contract files
24+
steps:
25+
# Checkout repo to use files of the repo as input for container action
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Find all contract files to verify
29+
id: filepaths
30+
run: |
31+
files=$(find src/contracts/ -maxdepth 1 -type f -name "*.h" ! -name "*TestExample*" ! -name "*math_lib*" ! -name "*qpi*" -printf "%p\n" | paste -sd, -)
32+
echo "contract-filepaths=$files" >> "$GITHUB_OUTPUT"
33+
- name: Contract verify action step
34+
id: verify
35+
uses: Franziska-Mueller/qubic-contract-verify@v0.3.3-beta
36+
with:
37+
filepaths: '${{ steps.filepaths.outputs.contract-filepaths }}'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ x64/
1313
.DS_Store
1414
.clang-format
1515
tmp
16+
build/

.idea/editor.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ include(CompilerSetup)
1212
# Build options
1313
option(BUILD_TESTS "Build the test suite" ON)
1414
option(BUILD_BENCHMARK "Build the EFI benchmark application" OFF)
15-
option(BUILD_EFI "Build the EFI application" ON)
15+
option(BUILD_BINARY "Build the EFI application" ON)
1616
option(USE_SANITIZER "Build test with sanitizer support (clang only)" ON)
1717

1818
if(IS_WINDOWS)
@@ -25,7 +25,7 @@ endif()
2525
# Always include platform_common as it's needed for both application and tests
2626
add_subdirectory(lib/platform_common)
2727

28-
if(BUILD_EFI OR BUILD_BENCHMARK)
28+
if(BUILD_BINARY OR BUILD_BENCHMARK)
2929
add_subdirectory(lib/platform_efi)
3030
endif()
3131

@@ -37,15 +37,15 @@ if(BUILD_TESTS)
3737

3838
# If we're not building the application, we still need src for tests
3939
# but don't make it a default target
40-
if(NOT BUILD_EFI)
40+
if(NOT BUILD_BINARY)
4141
add_subdirectory(src EXCLUDE_FROM_ALL)
4242
endif()
4343

4444
add_subdirectory(test)
4545
endif()
4646

4747
# Build the application if requested
48-
if(BUILD_EFI)
48+
if(BUILD_BINARY)
4949
message(STATUS "--- EFI Core application ---")
5050
add_subdirectory(src)
5151
endif()

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@ The lite version of Qubic Core that can run directly on the OS without a UEFI en
44

55
## Build
66

7+
### Pre-build Binary
8+
9+
Pre-build binary can be found here
710
> Lite Executable <br>
811
> [![Build](https://github.com/hackerby888/qubic-core-lite/actions/workflows/efi-build-develop.yml/badge.svg?branch=main)](https://github.com/hackerby888/qubic-core-lite/actions/workflows/efi-build-develop.yml)
912
> <br>
1013
> The executable is located in `QubicLiteBuildOutput.zip/x64/Release/Qubic.exe`
1114
15+
### Windows
16+
17+
- Open .sln file in project root folder in Visual Studio
18+
- Change build config to Release -> Right click at Qubic project -> Build
19+
20+
### Linux
21+
22+
Detailed instruction can be found here: [Linux Build Tutorial](./README_CLANG.md)
23+
1224
## Prerequisites
1325

1426
To run a qubic node, you need the following spec:
@@ -56,14 +68,16 @@ static const unsigned char knownPublicPeers[][4] = {
5668
- An epoch will have `TESTNET_EPOCH_DURATION` (**3000**) ticks by default, you can change it in `public_settings.h`
5769
- You can deploy your own RPC server of local devnet [how to](https://qubic-sc-docs.pages.dev/rpc/setup-rpc)
5870

71+
## FAQs
72+
73+
- **My node stop ticking after restart, why?**
74+
Delete the **system** file at your current working folder, it may make your node start with wrong state.
75+
5976
## Supporting Platform
6077

6178
- [x] Windows
62-
- [ ] Linux (Soon...)
79+
- [x] Linux
6380

6481
## Donate The Project
6582

6683
QUBIC Wallet: QPROLAPACSPVBDQADRXXKRGZMXADUAEXXJIQNWPGWFUFUAITRXMHVODDLGBK
67-
68-
69-

README_CLANG.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# qubic clang port
2-
The Qubic Core is currently ported to be compiled with clang. As this requires a lot of changes the port is develop along the main development work and continuously integrated. However this also implies that the compilation of the core code with clang is not resulting in a working node at the moment. Hence it shall now be used in production!
3-
1+
# Qubic Lite Core Linux Build
42

53
## Prerequisites
64
To be able to compile the core code with clang the following prerequisites have to be meet:
@@ -11,6 +9,14 @@ To be able to compile the core code with clang the following prerequisites have
119
1210
Potentially it also works with lower versions but isn't tested yet.
1311

12+
## Compiler Installation Commands
13+
14+
```
15+
sudo apt update && upgrade
16+
sudo apt install -y build-essential clang cmake nasm
17+
sudo apt install -y libc++-dev libc++abi-dev
18+
```
19+
1420
## Compilation
1521
Currently compilation with cmake and clang is only supported on Linux systems. Window and OSX might work but is not properly tested.
1622
For a example compilation execute the following commands:
@@ -38,7 +44,7 @@ For a example compilation execute the following commands:
3844

3945
```bash
4046
# In your build directory
41-
cmake .. -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -D BUILD_TESTS:BOOL=ON -D BUILD_EFI:BOOL=OFF -D CMAKE_BUILD_TYPE=Debug -D ENABLE_AVX512=ON
47+
cmake .. -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -D BUILD_TESTS:BOOL=OFF -D BUILD_BINARY:BOOL=ON -D CMAKE_BUILD_TYPE=Release -D ENABLE_AVX512=OFF
4248
```
4349

4450
There are a few option to set during configuration:
@@ -47,7 +53,7 @@ For a example compilation execute the following commands:
4753
* **Values:** `ON`, `OFF`
4854
* **Meaning:** `ON` builds the test suite, `OFF` skips building tests.
4955

50-
* **`-D BUILD_EFI=<ON|OFF>`**
56+
* **`-D BUILD_BINARY=<ON|OFF>`**
5157
* **Values:** `ON`, `OFF`
5258
* **Meaning:** `ON` builds the EFI file, `OFF` skips building EFI file. Currently this build is not working.
5359

@@ -79,11 +85,12 @@ For a example compilation execute the following commands:
7985
# Or if using Ninja (often the default if installed), it usually uses all cores by default
8086
```
8187

88+
The output binary will be located at `build/src`
8289

8390
## State
84-
At the moment the basic build scripts are setup and tests will be ported piece by piece.
8591

86-
Current state of the working tests:
92+
The core binary are finished but for building test are still pending
93+
8794
| Test Module | Source File | Status |
8895
| :----------------- | :---------------------- | :---------- |
8996
| Assets | `assets.cpp` | Pending |

doc/contracts.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,3 +632,6 @@ The file `proposal.cpp` has a lot of examples showing how to use both functions.
632632
For example, `getProposalIndices()` shows how to call a contract function requiring input and providing output with `runContractFunction()`.
633633
An example use case of `makeContractTransaction()` can be found in `gqmpropSetProposal()`.
634634
The function `castVote()` is a more complex example combining both, calling a contract function and invoking a contract procedure.
635+
636+
637+

doc/contributing.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ The code formatting rules are enforced using `clang-format`, ideally setup as a
191191
They are based on the "Microsoft" style with some custom modifications.
192192
Currently, the style guidelines are designed to improve consistency while minimizing the number of changes needed in the existing codebase.
193193

194+
#### Naming
195+
194196
The following naming rules are not strictly enforced, but should be followed at least in new code:
195197

196198
- **Preprocessor symbols** must be defined `ALL_CAPS`.
@@ -221,6 +223,21 @@ The following naming rules are not strictly enforced, but should be followed at
221223

222224
- **Functions** are named following the same pattern as variables. They usually start with a verb. Examples: `getComputerDigest()`, `processExchangePublicPeers()`, `initContractExec()`.
223225

226+
#### Curly Braces Style
227+
228+
Every opening curly brace should be on a new line. This applies to conditional blocks, loops, functions, classes, structs, etc. For example:
229+
230+
```
231+
if (cond)
232+
{
233+
// do something
234+
}
235+
else
236+
{
237+
// do something else
238+
}
239+
```
240+
224241

225242

226243
## Version naming scheme
@@ -373,3 +390,4 @@ Even when bound by serializing instructions, the system environment at the time
373390
[AMD64 Architecture Programmer's Manual, Volumes 1-5, 13.2.4 Time-Stamp Counter](https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/40332.pdf)
374391

375392
Another rich source: [Intel® 64 and IA-32 Architectures Software Developer's Manual Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4](https://cdrdv2.intel.com/v1/dl/getContent/671200)
393+

lib/platform_common/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ elseif(IS_LINUX_CLANG AND ASM_LANG STREQUAL ASM_NASM)
4747
COMMENT "Preprocessing/Assembling (NASM) ${NASM_SRC_LJ}"
4848
VERBATIM
4949
)
50-
add_library(LongJumpNasmObject OBJECT ${NASM_OBJ_LJ})
51-
set_target_properties(LongJumpNasmObject PROPERTIES LINKER_LANGUAGE C)
5250
list(APPEND ASM_OBJECT_LIBS LongJumpNasmObject)
5351

5452
# --- NASM File 2: SetJump ---
@@ -64,14 +62,12 @@ elseif(IS_LINUX_CLANG AND ASM_LANG STREQUAL ASM_NASM)
6462
COMMENT "Preprocessing/Assembling (NASM) ${NASM_SRC_SJ}"
6563
VERBATIM
6664
)
67-
add_library(SetJumpNasmObject OBJECT ${NASM_OBJ_SJ})
68-
set_target_properties(SetJumpNasmObject PROPERTIES LINKER_LANGUAGE C)
6965
list(APPEND ASM_OBJECT_LIBS SetJumpNasmObject)
7066

7167
endif()
7268

7369
# --- Target Definition ---
74-
add_library(platform_common STATIC ${C_SOURCES})
70+
add_library(platform_common STATIC ${C_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/LongJump.nasm.o ${CMAKE_CURRENT_BINARY_DIR}/SetJump.nasm.o)
7571

7672
# Apply common compiler flags from the centralized detection module
7773
apply_common_compiler_flags(platform_common)
@@ -81,7 +77,7 @@ if(ASM_OBJECT_LIBS)
8177
if(IS_WINDOWS)
8278
target_link_libraries(platform_common PRIVATE platform_common_asm)
8379
else()
84-
target_link_libraries(platform_common PRIVATE ${ASM_OBJECT_LIBS})
80+
# For Linux, link the object files directly
8581
endif()
8682
endif()
8783

lib/platform_common/long_jump.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extern "C"
4848
@retval 0 Indicates a return from SetJump().
4949
5050
**/
51-
unsigned long long _cdecl SetJump(LongJumpBuffer* JumpBuffer);
51+
unsigned long long SetJump(LongJumpBuffer* JumpBuffer);
5252

5353

5454
/**
@@ -67,6 +67,6 @@ extern "C"
6767
restored and must be non-zero.
6868
6969
**/
70-
void _cdecl LongJump(LongJumpBuffer* JumpBuffer, unsigned long long Value);
70+
void LongJump(LongJumpBuffer* JumpBuffer, unsigned long long Value);
7171

7272
}

0 commit comments

Comments
 (0)