Skip to content

Commit

Permalink
Merge branch 'release/v3.1.0' into 'master'
Browse files Browse the repository at this point in the history
Release/v3.1.0

See merge request in3/c/in3-core!371
  • Loading branch information
simon-jentzsch committed Oct 5, 2020
2 parents 8a6cf43 + 4871b80 commit 876bdac
Show file tree
Hide file tree
Showing 2,644 changed files with 928,998 additions and 5,230 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ c/src/third-party/hidapi/missing
c/src/third-party/hidapi/depcomp
c/src/third-party/hidapi/compile
c/src/third-party/hidapi/aclocal.m4
c/.clang-format
95 changes: 87 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,90 @@
{
"type": "lldb",
"request": "launch",
"name": "in3 cmd",
"name": "in3 deposit",
"program": "${workspaceFolder}/build/bin/in3",
"cwd": "${workspaceFolder}",
"externalConsole": true,
"args": [
"-ccache",
"-a",
"3",
"call",
"totalNodes():uint",
"-to",
"0x6c095a05764a23156efd9d603eada144a9b1af33",
"-fo",
"debugDeposit.txt",
"-zks",
"http://localhost:3030",
"-c",
"http://localhost:8545",
"-pk",
"0xe20eb92b34a3c5bd2ef0802a4bc443a90e73fc4a0edc4781446d7b22a44cc5d8",
"zksync_deposit",
"0x3635C9ADC5DEA00000",
"ETH",
"false",
"-debug"
]
},
{
"type": "lldb",
"request": "launch",
"name": "in3 transfer",
"program": "${workspaceFolder}/build/bin/in3",
"cwd": "${workspaceFolder}/build/bin",
"externalConsole": true,
"args": [
"-fi",
"transfer.txt",
"-debug"
]
},
{
"type": "lldb",
"request": "launch",
"name": "in3 withdraw",
"program": "${workspaceFolder}/build/bin/in3",
"cwd": "${workspaceFolder}/build/bin",
"externalConsole": true,
"args": [
"-fi",
"debugWithdraw.txt",
"-debug"
]
},
{
"type": "lldb",
"request": "launch",
"name": "in3 setKEy",
"program": "${workspaceFolder}/build/bin/in3",
"cwd": "${workspaceFolder}/build/bin",
"externalConsole": true,
"args": [
"-fo",
"debugSetKey.txt",
"-zks",
"http://localhost:3030",
"-c",
"http://localhost:8545",
"-pk",
"0xe20eb92b34a3c5bd2ef0802a4bc443a90e73fc4a0edc4781446d7b22a44cc5d8",
"zksync_setKey",
"-debug"
]
},
{
"type": "lldb",
"request": "launch",
"name": "in3 emergencyWithdraw",
"program": "${workspaceFolder}/build/bin/in3",
"cwd": "${workspaceFolder}/build/bin",
"externalConsole": true,
"args": [
"-fo",
"emergencyWithdraw.txt",
"-zks",
"http://localhost:3030",
"-c",
"http://localhost:8545",
"-pk",
"0xe20eb92b34a3c5bd2ef0802a4bc443a90e73fc4a0edc4781446d7b22a44cc5d8",
"zksync_emergencyWithdraw",
"ETH",
"-debug"
]
},
Expand Down Expand Up @@ -85,6 +157,13 @@
"program": "${workspaceFolder}/build/test/test_cache",
"cwd": "${workspaceFolder}/build"
},
{
"type": "lldb",
"request": "launch",
"name": "run recorder test",
"program": "${workspaceFolder}/build/test/test_recorder",
"cwd": "${workspaceFolder}/build"
},
{
"type": "lldb",
"request": "launch",
Expand Down
26 changes: 25 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,29 @@ option(USE_SCRYPT "integrate scrypt into the build in order to allow decrypt_key
option(USE_CURL "if true the curl transport will be built (with a dependency to libcurl)" ON)
option(USE_WINHTTP "if true the winhttp transport will be built (with a dependency to winhttp)" OFF)
option(DEV_NO_INTRN_PTR "(*dev option*) if true the client will NOT include a void pointer (named internal) for use by devs)" ON)
option(DEV_NO_INC_RPC_ID "(*dev option*) if true the client will NOT track/increment JSON RPC id count" OFF)
option(LEDGER_NANO "include support for nano ledger" OFF)
option(ESP_IDF "include support for ESP-IDF microcontroller framework" OFF)
option(ASSERTIONS "includes assertions into the code, which help track errors but may cost time during runtime" OFF)
OPTION(TRANSPORTS "builds transports, which may require extra libraries." ON)
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)
OPTION(CMD "build the comandline utils" ON)
OPTION(RECORDER "enable recording option for reproduce executions" ON)
OPTION(POA "support POA verification including validatorlist updates" OFF)
OPTION(MULTISIG "add capapbility to sign with a multig. Currrently only gnosis safe is supported" OFF)
OPTION(ZKSYNC "add RPC-functioin to handle zksync-payments" OFF)
OPTION(ZKSYNC "add RPC-functioin to handle zksync-payments" ON)
OPTION(SENTRY "Enable Sentry" OFF)
OPTION(PK_SIGNER "Enable Signing with private keys" ON)

IF (POA)
ADD_DEFINITIONS(-DPOA)
ENDIF (POA)

IF (PK_SIGNER)
ADD_DEFINITIONS(-DPK_SIGNER)
set(IN3_API ${IN3_API} pk_signer)
ENDIF (PK_SIGNER)

if (USE_PRECOMPUTED_EC)
ADD_DEFINITIONS(-DUSE_PRECOMPUTED_CP=1)
else()
Expand All @@ -100,6 +109,7 @@ endif()

if (ZKSYNC)
ADD_DEFINITIONS(-DZKSYNC)
set(WASM_MODULES ${WASM_MODULES} zksync)
set(IN3_API ${IN3_API} zksync)
endif()

Expand Down Expand Up @@ -182,10 +192,23 @@ if(SEGGER_RTT)
ADD_DEFINITIONS(-DSEGGER_RTT)
endif(SEGGER_RTT)

if(RECORDER)
ADD_DEFINITIONS(-DRECORDER)
endif(RECORDER)

if (DEV_NO_INTRN_PTR)
ADD_DEFINITIONS(-DDEV_NO_INTRN_PTR)
endif()

if (DEV_NO_INC_RPC_ID)
ADD_DEFINITIONS(-DDEV_NO_INC_RPC_ID)
endif()

if (SENTRY)
ADD_DEFINITIONS(-DSENTRY)
set(IN3_API ${IN3_API} in3_sentry)
endif()

# handle version
if (TAG_VERSION)
set(PROJECT_VERSION "${TAG_VERSION}")
Expand Down Expand Up @@ -214,6 +237,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

IF (WASM)
set(TEST false)
set(RECORDER false)
set(TRANSPORTS false)
set(BUILD_DOC false)
set(IN3_LIB false)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ int main(int argc, char* argv[]) {
## Contributors welcome!
We at Slock.it believe in the power of the open source community. Feel free to open any issues you may come across, fork
We at Blockchains believe in the power of the open source community. Feel free to open any issues you may come across, fork
the repository and integrate in your own projects. You can reach us on various social media platforms for any questions
and suggestions.
Expand Down
10 changes: 7 additions & 3 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ add_subdirectory(src/signer)
add_subdirectory(src/pay)
add_subdirectory(src/api)
add_subdirectory(src/cmd)
add_subdirectory(src/tools)

add_subdirectory(docs)

link_directories(${CMAKE_BINARY_DIR}/lib/)
Expand All @@ -82,10 +84,12 @@ if (IN3_LIB)
add_library(in3_lib SHARED ${IN3_LIBS} )
set_target_properties(in3_bundle PROPERTIES OUTPUT_NAME "in3")
set_target_properties(in3_lib PROPERTIES OUTPUT_NAME "in3")
target_link_libraries(in3_lib ${IN3_TRANSPORT})
if( LEDGER_NANO)
target_link_libraries(in3_lib ${IN3_TRANSPORT} ledger_signer)
else()
target_link_libraries(in3_lib ${IN3_TRANSPORT} )
target_link_libraries(in3_lib ledger_signer)
endif()
if(SENTRY)
target_link_libraries(in3_lib sentry)
endif()

# install
Expand Down
12 changes: 9 additions & 3 deletions c/ci-analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+.[0-9]+.[0-9]+-(alpha|beta|rc)\.[0-9]+$/'
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "develop"'
- if: '$CI_COMMIT_REF_PROTECTED == "true"'

coverage:
stage: analysis
Expand All @@ -16,7 +17,7 @@ coverage:
- short-jobs
script:
- mkdir cov_build; cd cov_build
- cmake -DIN3API=true -DIN3_LIB=false -DCMD=false -DUSE_CURL=false -DTEST=true -DCODE_COVERAGE=true -DUSE_SEGGER_RTT=false -DTRANSPORTS=false -DCMAKE_BUILD_TYPE=Debug ..
- cmake -DIN3API=true -DIN3_LIB=false -DUSE_CURL=false -DTEST=true -DZKSYNC=true -DCODE_COVERAGE=true -DUSE_SEGGER_RTT=false -DTRANSPORTS=false -DCMAKE_BUILD_TYPE=Debug ..
- make -j8 && make ptest
- ../scripts/lcov_report.sh | xargs llvm-cov report
- ../scripts/lcov_report.sh | xargs llvm-cov show -show-line-counts-or-regions -output-dir=ccov/all-merged -format=html
Expand Down Expand Up @@ -44,7 +45,7 @@ clangcheck:

cppcheck:
stage: analysis
image: docker.slock.it/build-images/cmake:gcc-x86-static-analysis
image: docker.slock.it/build-images/cmake:gcc10
extends: .only_full
allow_failure: true
needs: []
Expand All @@ -54,8 +55,9 @@ cppcheck:
- mkdir _build
- cd _build
- cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release ..
- sed -i 's/\\\\\\/\\/g' compile_commands.json
- cd ..
- cppcheck --project=_build/compile_commands.json -i/builds/in3/c/in3-core/c/test/unity -i/builds/in3/c/in3-core/c/src/third-party
- cppcheck --quiet --project=_build/compile_commands.json -i/usr/include -i/builds/in3/c/in3-core/c/test -i/builds/in3/c/in3-core/c/src/third-party

gcc10check:
stage: analysis
Expand Down Expand Up @@ -95,6 +97,7 @@ code_quality:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+.[0-9]+.[0-9]+(\-RC[0-9]+)?$/'
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
stage: analysis
needs: []
tags:
Expand Down Expand Up @@ -133,6 +136,7 @@ vulnerabilities:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+.[0-9]+.[0-9]+(\-RC[0-9]+)?$/'
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
stage: analysis
extends: .only_full
allow_failure: true
Expand All @@ -142,6 +146,8 @@ vulnerabilities:
- short-jobs
image: docker.slock.it/build-images/vulnerability-testing-tools
script:
- export COMMIT_IMAGE_TAG="$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME/\//_}"
- echo $COMMIT_IMAGE_TAG
- export TRIVY_AUTH_URL=$CI_REGISTRY
- export TRIVY_USERNAME=gitlab-ci-token
- export TRIVY_PASSWORD=$CI_JOB_TOKEN
Expand Down
8 changes: 6 additions & 2 deletions c/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.only_deploy:
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+.[0-9]+.[0-9]+(\-RC[0-9]+)?$/'
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
when: manual

.only_full:
Expand All @@ -11,6 +12,7 @@
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+.[0-9]+.[0-9]+-(alpha|beta|rc)\.[0-9]+$/'
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "develop"'
- if: '$CI_COMMIT_REF_PROTECTED == "true"'

dockerhub-deploy:
stage: deploy
Expand Down Expand Up @@ -40,6 +42,7 @@ readthedocs:
- gcc8
- python
- dotnet
- wasm
extends: .only_full
tags:
- short-jobs
Expand All @@ -59,9 +62,10 @@ readthedocs:
- bin/slockit-doxygen ../x64_build/java/docs/doc_doxygen/xml "# API Reference Java\n\n" java > ../doc/docs/api-java.md
- chmod 777 bin/*
- cd ../wasm/src
- cp ../../wasm_build/module/index.d.ts .
- npm --cache .npm i typedoc
- node_modules/.bin/typedoc --includeDeclarations --ignoreCompilerErrors --readme none --target ES6 --mode 'modules' --excludeExternals --json doc.json in3.d.ts
- cat doc.json | ../../generator/bin/slockit-docu in3.d slockit/in3-c/blob/master/wasm/src "$PRE_DOC" > ../../doc/docs/api-wasm.md
- node_modules/.bin/typedoc --includeDeclarations --ignoreCompilerErrors --readme none --target ES6 --mode 'modules' --excludeExternals --json doc.json index.d.ts
- cat doc.json | ../../generator/bin/slockit-docu index.d slockit/in3-c/blob/master/wasm/src "$PRE_DOC" > ../../doc/docs/api-wasm.md
- cd ../../doc/docs && make html && make latexpdf && make text
artifacts:
paths:
Expand Down
26 changes: 25 additions & 1 deletion c/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
.only_release:
only:
- /^release\/v[0-9]+\.[0-9]+\.[0-9]+$/

.only_full:
rules:
- changes:
- c/**/*
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+.[0-9]+.[0-9]+-(alpha|beta|rc)\.[0-9]+$/'
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "develop"'
- if: '$CI_COMMIT_REF_PROTECTED == "true"'

.conanbuild:
stage: build
Expand Down Expand Up @@ -157,6 +162,8 @@ docker:
- docker:dind
image: docker.slock.it/build-images/deployment
script:
- export COMMIT_IMAGE_TAG="$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME/\//_}"
- echo $COMMIT_IMAGE_TAG
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $COMMIT_IMAGE_TAG || true
- docker build --cache-from $COMMIT_IMAGE_TAG -t $COMMIT_IMAGE_TAG .
Expand All @@ -175,7 +182,7 @@ test_c:
script:
- mkdir testbuild
- cd testbuild
- cmake -DTEST=true -DTAG_VERSION=$CI_COMMIT_TAG -DEVM_GAS=true -DCMAKE_BUILD_TYPE=Debug -DLIBCURL_TYPE=shared ..
- cmake -DTEST=true -DTAG_VERSION=$CI_COMMIT_TAG -DEVM_GAS=true -DZKSYNC=true -DCMAKE_BUILD_TYPE=Debug -DLIBCURL_TYPE=shared ..
- make
- ctest -V | tee ../mac_test_c.log | test/junit > ../mac_test_c.xml
artifacts:
Expand Down Expand Up @@ -257,3 +264,20 @@ examples_macos:
- ./build.sh
tags:
- mac-os


integration_longrun:
stage: test
extends: .only_release
trigger:
project: qa/long-run
strategy: depend
branch: develop

integration_browsertest:
stage: test
extends: .only_release
trigger:
project: in3/ts/browser-test
strategy: depend
branch: 2-release-branch-test
6 changes: 3 additions & 3 deletions c/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else(MSVC)
endif()
endif(MSVC)
if (WASM)
set (CMAKE_C_FLAGS "-Wall -funsigned-char -Wextra -std=c99")
set (CMAKE_C_FLAGS "-Wall -funsigned-char -Wextra -std=c99 ")
set (CMAKE_CXX_FLAGS "-Wall -funsigned-char -Wextra -std=c99 -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined,address -fsanitize-minimal-runtime")
Expand All @@ -23,9 +23,9 @@ endif(WASM)
if(MSVC)
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX")
elseif(WASM)
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-missing-braces")
else()
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror=vla")
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror=vla -Wno-missing-braces")
endif()

set_property(GLOBAL PROPERTY C_STANDARD 99)
Expand Down
Loading

0 comments on commit 876bdac

Please sign in to comment.