Skip to content

Commit 70c5ead

Browse files
Merge branch 'develop' into 'master'
Release See merge request in3/c/in3-core!469
2 parents de5572c + 2635f6d commit 70c5ead

File tree

208 files changed

+11234
-4094
lines changed

Some content is hidden

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

208 files changed

+11234
-4094
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ coverage_report
22
test/bindings/wasm/node_modules/
33
**/node_modules/
44
**/package-lock.json
5+
c/src/init/autoregister.h
56
Testing*
67
wasm/test/in3
78
.in3
@@ -18,6 +19,7 @@ cmake-build-debug/
1819
.idea/
1920
.settings/
2021
# Vim
22+
swift/.swiftpm/
2123
python/htmlcov
2224
wasm/test/.nyc_output
2325
wasm/test/coverage
@@ -31,6 +33,7 @@ bin/
3133
.classpath
3234
.project
3335
*.class
36+
python/**/*.pyc
3437
target/
3538
.cproject
3639
.overcommit.yml
@@ -49,3 +52,8 @@ c/src/third-party/hidapi/compile
4952
c/src/third-party/hidapi/aclocal.m4
5053
c/examples/CMakeLists.txt
5154
c/.clang-format
55+
swift/**/.DS_Store
56+
swift/**/.build
57+
swift/**/Packages
58+
swift/**/*.xcodeproj
59+
swift/**/xcuserdata/

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ stages:
3030
- python
3131
- dotnet
3232
- java
33+
- swift
3334
- test
3435
- analysis
3536
- deploy
3637
- release
3738

3839
# all the CI files to include and run, they are imported before the CI is started
3940
include:
40-
- local: "code-quality.gitlab-ci.yml"
41+
- local: "/.gitlab/code-quality.gitlab-ci.yml"
4142
- local: "/c/ci.yml"
4243
- local: "/c/ci-analyse.yml"
4344
- local: "/c/ci-deploy.yml"

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@
9191
"sha2.h": "c",
9292
"pb_decode.h": "c",
9393
"ios": "c",
94-
"filesystem": "c"
94+
"filesystem": "c",
95+
"plugin.h": "c",
96+
"request.h": "c",
97+
"nodeselect_def.h": "c",
98+
"in3_winhttp.h": "c",
99+
"ed25519-hash-custom.h": "c"
95100
},
96101
"C_Cpp.errorSquiggles": "Disabled",
97102
"C_Cpp.clang_format_fallbackStyle": "{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AlignConsecutiveDeclarations: true, AlignTrailingComments: true, AllowShortBlocksOnASingleLine: true, AllowShortCaseLabelsOnASingleLine: true, AllowShortIfStatementsOnASingleLine: true }",

CMakeLists.txt

Lines changed: 1 addition & 239 deletions
Original file line numberDiff line numberDiff line change
@@ -38,253 +38,15 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/scripts/cmake_mo
3838
# project name
3939
project(in3)
4040

41-
# options
42-
option(BUILD_DOC "generates the documenation with doxygen." OFF)
43-
option(TAG_VERSION "the tagged version, which should be used" 3.0.0)
44-
option(ETH_NANO "build minimal eth verification.(eth_getTransactionReceipt)" ON)
45-
option(ETH_BASIC "build basic eth verification.(all rpc-calls except eth_call)" ON)
46-
option(ETH_FULL "build full eth verification.(including eth_call)" ON)
47-
option(IPFS "build IPFS verification" ON)
48-
option(COLOR "Enable color codes for debug" ON)
49-
option(BTC "if true, the bitcoin verifiers will be build" ON)
50-
option(IN3API "build the USN-API which offer better interfaces and additional functions on top of the pure verification" ON)
51-
option(USE_PRECOMPUTED_EC "if true the secp256k1 curve uses precompiled tables to boost performance. turning this off makes ecrecover slower, but saves about 37kb." ON)
52-
option(LOGGING "if set logging and human readable error messages will be inculded in th executable, otherwise only the error code is used. (saves about 19kB)" ON)
53-
option(EVM_GAS "if true the gas costs are verified when validating a eth_call. This is a optimization since most calls are only interessted in the result. EVM_GAS would be required if the contract uses gas-dependend op-codes." true)
54-
option(IN3_LIB "if true a shared anmd static library with all in3-modules will be build." ON)
55-
option(TEST "builds the tests and also adds special memory-management, which detects memory leaks, but will cause slower performance" OFF)
56-
option(FAST_MATH "Math optimizations used in the EVM. This will also increase the filesize." OFF)
57-
option(SEGGER_RTT "Use the segger real time transfer terminal as the logging mechanism" OFF)
58-
option(CURL_BLOCKING "if true the curl-request will block until the response is received" OFF)
59-
option(JAVA "build the java-binding (shared-lib and jar-file)" OFF)
60-
option(JAVA_MULTI_LIBS "embedds multiple shared libs in the jar" OFF)
61-
option(WASM "Includes the WASM-Build. In order to build it you need emscripten as toolchain. Usually you also want to turn off other builds in this case." OFF)
62-
option(ASMJS "compiles the code as asm.js." OFF)
63-
option(WASM_EMBED "embedds the wasm as base64-encoded into the js-file" ON)
64-
option(WASM_EMMALLOC "use ther smaller EMSCRIPTEN Malloc, which reduces the size about 10k, but may be a bit slower" ON)
65-
option(WASM_SYNC "intiaializes the WASM synchronisly, which allows to require and use it the same function, but this will not be supported by chrome (4k limit)" OFF)
66-
option(CODE_COVERAGE "Builds targets with code coverage instrumentation. (Requires GCC or Clang)" OFF)
67-
option(GCC_ANALYZER "GCC10 static code analyses" OFF)
68-
option(PAY_ETH "support for direct Eth-Payment" OFF)
69-
option(USE_SCRYPT "integrate scrypt into the build in order to allow decrypt_key for scrypt encoded keys." ON)
70-
option(USE_CURL "if true the curl transport will be built (with a dependency to libcurl)" ON)
71-
option(USE_WINHTTP "if true the winhttp transport will be built (with a dependency to winhttp)" OFF)
72-
option(LEDGER_NANO "include support for nano ledger" OFF)
73-
option(ESP_IDF "include support for ESP-IDF microcontroller framework" OFF)
74-
option(ASSERTIONS "includes assertions into the code, which help track errors but may cost time during runtime" OFF)
75-
OPTION(TRANSPORTS "builds transports, which may require extra libraries." ON)
76-
OPTION(IN3_SERVER "support for proxy server as part of the cmd-tool, which allows to start the cmd-tool with the -p option and listens to the given port for rpc-requests" OFF)
77-
OPTION(CMD "build the comandline utils" ON)
78-
OPTION(RECORDER "enable recording option for reproduce executions" ON)
79-
OPTION(POA "support POA verification including validatorlist updates" OFF)
80-
OPTION(MULTISIG "add capapbility to sign with a multig. Currrently only gnosis safe is supported" ON)
81-
OPTION(ZKSYNC "add RPC-function to handle zksync-payments" ON)
82-
OPTION(ZKCRYPTO_LIB "Path to the static zkcrypto-lib" OFF)
83-
OPTION(SENTRY "Enable Sentry" OFF)
84-
OPTION(BTC_PRE_BPI34 "Enable BTC-Verfification for blocks before BIP34 was activated" ON)
85-
OPTION(PK_SIGNER "Enable Signing with private keys" ON)
86-
OPTION(NODESELECT_DEF "Enable default nodeselect implementation" ON)
87-
OPTION(NODESELECT_DEF_WL "Enable default nodeselect whitelist implementation" ON)
88-
OPTION(PLGN_CLIENT_DATA "Enable client-data plugin" OFF)
89-
OPTION(THREADSAFE "uses mutex to protect shared nodelist access" ON)
90-
91-
92-
IF (DEFINED ANDROID_ABI)
93-
set(TRANSPORTS,false)
94-
set(IN3_LIB,false)
95-
set(USE_CURL,false)
96-
set(CMD,false)
97-
set(JAVA,true)
98-
set(RECORDER,false)
99-
ENDIF()
100-
101-
IF (BTC_PRE_BPI34)
102-
ADD_DEFINITIONS(-DBTC_PRE_BPI34)
103-
ENDIF (BTC_PRE_BPI34)
104-
105-
IF (POA)
106-
ADD_DEFINITIONS(-DPOA)
107-
ENDIF (POA)
108-
109-
IF (PK_SIGNER)
110-
ADD_DEFINITIONS(-DPK_SIGNER)
111-
set(IN3_API ${IN3_API} pk_signer)
112-
ENDIF (PK_SIGNER)
113-
114-
if (USE_PRECOMPUTED_EC)
115-
ADD_DEFINITIONS(-DUSE_PRECOMPUTED_CP=1)
116-
else()
117-
ADD_DEFINITIONS(-DUSE_PRECOMPUTED_CP=0)
118-
endif()
119-
120-
if (LOGGING)
121-
ADD_DEFINITIONS(-DLOGGING)
122-
endif()
123-
124-
if (MULTISIG)
125-
ADD_DEFINITIONS(-DMULTISIG)
126-
endif()
127-
128-
if (ZKSYNC)
129-
ADD_DEFINITIONS(-DZKSYNC)
130-
set(WASM_MODULES ${WASM_MODULES} zksync)
131-
set(IN3_API ${IN3_API} zksync)
132-
endif()
133-
134-
135-
if(ETH_FULL)
136-
ADD_DEFINITIONS(-DETH_FULL)
137-
set(IN3_VERIFIER eth_full)
138-
set(ETH_BASIC true)
139-
set(ETH_NANO true)
140-
elseif(ETH_BASIC)
141-
ADD_DEFINITIONS(-DETH_BASIC)
142-
set(IN3_VERIFIER eth_basic)
143-
set(ETH_NANO true)
144-
elseif(ETH_NANO)
145-
ADD_DEFINITIONS(-DETH_NANO)
146-
set(IN3_VERIFIER eth_nano)
147-
endif()
148-
149-
if (ETH_NANO)
150-
set(WASM_MODULES ${WASM_MODULES} eth)
151-
endif()
152-
153-
if(IN3API)
154-
ADD_DEFINITIONS(-DETH_API)
155-
set(IN3_API ${IN3_API} eth_api)
156-
endif()
157-
158-
if (ESP_IDF)
159-
ADD_DEFINITIONS(-DESP_IDF)
160-
endif()
161-
162-
if(PAY_ETH)
163-
ADD_DEFINITIONS(-DPAY_ETH -DPAY)
164-
set(IN3_API ${IN3_API} pay_eth)
165-
endif()
166-
167-
if(IPFS)
168-
ADD_DEFINITIONS(-DIPFS)
169-
set(IN3_VERIFIER ${IN3_VERIFIER} ipfs)
170-
set(WASM_MODULES ${WASM_MODULES} ipfs)
171-
172-
if(IN3API)
173-
set(IN3_API ${IN3_API} ipfs_api)
174-
endif()
175-
endif()
176-
177-
if(BTC)
178-
ADD_DEFINITIONS(-DBTC)
179-
set(IN3_VERIFIER ${IN3_VERIFIER} btc)
180-
set(WASM_MODULES ${WASM_MODULES} btc)
181-
if(IN3API)
182-
set(IN3_API ${IN3_API} btc_api)
183-
endif()
184-
endif()
185-
186-
if(LEDGER_NANO)
187-
add_definitions(-DLEDGER_NANO)
188-
endif()
189-
190-
if(COLOR AND NOT (MSVC OR MSYS OR MINGW))
191-
ADD_DEFINITIONS(-DLOG_USE_COLOR)
192-
endif()
193-
194-
195-
if(CMAKE_BUILD_TYPE MATCHES Debug)
196-
ADD_DEFINITIONS(-DDEBUG)
197-
endif(CMAKE_BUILD_TYPE MATCHES Debug)
198-
199-
if(EVM_GAS)
200-
ADD_DEFINITIONS(-DEVM_GAS)
201-
endif(EVM_GAS)
202-
203-
if(FAST_MATH)
204-
ADD_DEFINITIONS(-DIN3_MATH_FAST)
205-
else()
206-
ADD_DEFINITIONS(-DIN3_MATH_LITE)
207-
endif(FAST_MATH)
208-
209-
if(SEGGER_RTT)
210-
ADD_DEFINITIONS(-DSEGGER_RTT)
211-
endif(SEGGER_RTT)
212-
213-
if(RECORDER)
214-
ADD_DEFINITIONS(-DRECORDER)
215-
endif(RECORDER)
216-
217-
if (SENTRY)
218-
ADD_DEFINITIONS(-DSENTRY)
219-
set(IN3_API ${IN3_API} in3_sentry)
220-
endif()
221-
222-
if (NODESELECT_DEF)
223-
ADD_DEFINITIONS(-DNODESELECT_DEF)
224-
if (NODESELECT_DEF_WL)
225-
ADD_DEFINITIONS(-DNODESELECT_DEF_WL)
226-
endif()
227-
set(IN3_NODESELECT ${IN3_NODESELECT} nodeselect_def)
228-
endif()
229-
230-
# handle version
231-
if (TAG_VERSION)
232-
set(PROJECT_VERSION "${TAG_VERSION}")
233-
else(TAG_VERSION)
234-
set(PROJECT_VERSION "3.0.0-local")
235-
endif(TAG_VERSION)
236-
237-
MESSAGE(STATUS "Building version ${PROJECT_VERSION}")
238-
239-
string(REPLACE "." ";" VERSION_LIST ${PROJECT_VERSION})
240-
list(GET VERSION_LIST 0 PROJECT_VERSION_MAJOR)
241-
list(GET VERSION_LIST 1 PROJECT_VERSION_MINOR)
242-
list(GET VERSION_LIST 2 PROJECT_VERSION_PATCH)
243-
244-
ADD_DEFINITIONS("-DIN3_VERSION=\"${PROJECT_VERSION}\"")
245-
ADD_DEFINITIONS(-DIN3_VERSION_MAJOR=${PROJECT_VERSION_MINOR})
246-
ADD_DEFINITIONS(-DIN3_VERSION_MINOR=${PROJECT_VERSION_MINOR})
247-
ADD_DEFINITIONS(-DIN3_VERSION_PATCH=${PROJECT_VERSION_PATCH})
248-
249-
250-
# define output dir structure
251-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
252-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
253-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
254-
41+
include("c/options.cmake")
25542

25643
IF (WASM)
257-
set(TEST false)
258-
set(RECORDER false)
259-
set(TRANSPORTS false)
260-
set(BUILD_DOC false)
261-
set(IN3_LIB false)
262-
set(CMD false)
263-
set(USE_CURL false)
264-
set(USE_WINHTTP false)
265-
set(THREADSAFE false)
266-
ADD_DEFINITIONS(-DWASM)
26744
add_subdirectory(wasm/src)
26845
ENDIF (WASM)
26946

270-
if (THREADSAFE)
271-
ADD_DEFINITIONS(-DTHREADSAFE)
272-
ENDIF()
273-
27447
# build tests
27548
if(TEST)
276-
ADD_DEFINITIONS(-DTEST)
277-
ADD_DEFINITIONS(-DIN3_EXPORT_TEST=)
278-
ADD_DEFINITIONS(-DIN3_IMPORT_TEST=extern)
279-
ADD_DEFINITIONS(-DDEBUG)
280-
SET(CMAKE_BUILD_TYPE Debug)
281-
enable_testing()
28249
add_subdirectory(c/test)
283-
add_custom_target(ptest COMMAND ${CMAKE_CTEST_COMMAND} -j 8)
284-
add_custom_target(rtest COMMAND ${CMAKE_CTEST_COMMAND} -V )
285-
else(TEST)
286-
ADD_DEFINITIONS(-DIN3_EXPORT_TEST=static)
287-
ADD_DEFINITIONS(-DIN3_IMPORT_TEST=)
28850
endif(TEST)
28951

29052
add_subdirectory(c)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is part of the Incubed project.
33
# Sources: https://github.com/blockchainsllc/in3
44
#
5-
# Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
5+
# Copyright (C) 2018-2021 slock.it GmbH, Blockchains LLC
66
#
77
#
88
# COMMERCIAL LICENSE USAGE
@@ -38,15 +38,15 @@ COPY c /in3/c/
3838
COPY scripts /in3/scripts/
3939
WORKDIR /in3/
4040
USER root
41-
RUN apt-get update && apt-get install -y libcurl4-openssl-dev curl cmake build-essential
41+
RUN apt-get clean && apt-get update && apt-get install -y libcurl4-openssl-dev curl cmake build-essential
4242
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
4343
ENV PATH="/root/.cargo/bin:${PATH}"
4444
RUN cd /in3/ && mkdir build && cd build && cmake -DZKCRYPTO_LIB=true -DCMAKE_BUILD_TYPE=MinSizeRel -DIN3_SERVER=true .. && make in3
4545

4646

4747
FROM debian:buster-slim
4848
COPY --from=build /in3/build/bin/in3 /bin/in3
49-
RUN apt-get update && apt-get install -y curl
49+
RUN apt-get clean && apt-get update && apt-get install -y curl
5050
EXPOSE 8545
5151
ENTRYPOINT ["/bin/in3"]
5252
CMD ["--help"]

0 commit comments

Comments
 (0)