Skip to content

Commit 3a67bec

Browse files
committed
Merge branch 'develop' of gitlab.peersafe.cn:chainsql/chainsqld into develop
2 parents b3abe5e + 8979b36 commit 3a67bec

File tree

108 files changed

+2266
-845
lines changed

Some content is hidden

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

108 files changed

+2266
-845
lines changed

Builds/CMake/ChainsqldCore.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ target_sources (chainsqld PRIVATE
731731
src/peersafe/precompiled/TableOpPrecompiled.cpp
732732
src/peersafe/precompiled/ToolsPrecompiled.cpp
733733
src/peersafe/precompiled/Utils.cpp
734+
src/peersafe/precompiled/ripemd160.cpp
734735
src/peersafe/protocol/impl/Contract.cpp
735736
src/peersafe/protocol/impl/STEntry.cpp
736737
src/peersafe/protocol/impl/STMap256.cpp

Builds/CMake/deps/Mysql.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
FIND_LIBRARY(MYSQL_LIBRARY
1313
NAMES ${MYSQL_NAMES}
1414
PATHS ${MYSQL_LIBRARY_DIR}
15+
NO_DEFAULT_PATH
1516
)
1617
else()
1718
find_program(HOMEBREW brew)

Builds/CMake/deps/Secp256k1.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if(secp256k1)
2222

2323
else()
2424
set(INSTALL_SECP256K1 true)
25+
add_definitions(-DENABLE_MODULE_RECOVERY)
2526

2627
add_library (secp256k1 STATIC
2728
src/secp256k1/src/secp256k1.c)

Builds/CMake/deps/Soci.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ else()
4242
ExternalProject_Add (soci
4343
PREFIX ${nih_cache_path}
4444
GIT_REPOSITORY https://github.com/ChainSQL/soci.git
45-
GIT_TAG chainsql
46-
GIT_SHALLOW ON
45+
GIT_TAG c6e581399415d6bc366a83532e85ae64e0204ef4
46+
#GIT_SHALLOW ON
4747
# We had an issue with soci integer range checking for boost::optional
4848
# and needed to remove the exception that SOCI throws in this case.
4949
# This is *probably* a bug in SOCI, but has never been investigated more

Builds/WinVS/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
| [Git for Windows](README.md#install-git-for-windows)| 2.16.1 |
1111
| [OpenSSL Library](README.md#install-openssl) | 1.0.2u或者1.1.0+ |
1212
| [Goole Protocol Buffers Complier](README.md#install-protocol) | 2.5 |
13-
| [Boost library](README.md#build-boost) | 1.70.0 |
13+
| [Boost library](README.md#build-boost) | 1.73.0 |
1414
| [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 |
1515
| [mysql](README.md#install-mysql) | 5.6 |
1616

@@ -38,14 +38,14 @@
3838
> 2. 安装完 OpenSSL 后,并将 OPENSSL_ROOT_DIR 环境变量设置为 OpenSSL 安装路径
3939
4040
### install boost
41-
> 1. 下载 [boost 1.70 ](http://www.boost.org/users/news/)
41+
> 1. 下载 [boost 1.73 ](http://www.boost.org/users/news/)
4242
> 2. 编译 boost,注意下面的Num Parallel需要指定一个并行编译数量,如:2
4343
```cmd
44-
> cd C:\lib\boost_1_70_0
44+
> cd C:\lib\boost_1_73_0
4545
> bootstrap
4646
> bjam -j<Num Parallel> --toolset=msvc-14.1 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared,static stage --stagedir=stage64
4747
```
48-
> 3. 将 BOOST_ROOT 环境变量设置为 C:\lib\boost_1_70_0
48+
> 3. 将 BOOST_ROOT 环境变量设置为 C:\lib\boost_1_73_0
4949
5050
### install mysql
5151
> 1. 下载 [mysql8.0 for windows](https://dev.mysql.com/downloads/installer/)。建议优先选择 x86,64-bit 的压缩包并安装。

Builds/linux/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|-----------|-----------------------|
88
| gcc | 7.4.0+ |
99
| cmake | 3.12+ |
10-
| boost | 1.70.0+ |
10+
| boost | 1.73.0+ |
1111

1212

1313
## 安装开发环境依赖
@@ -41,9 +41,9 @@ apt-get install -y gcc g++ wget git cmake pkg-config protobuf-compiler libprotob
4141
### Boost安装
4242
- 进入编译目录
4343
```bash
44-
wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz
45-
tar -xzf boost_1_70_0.tar.gz
46-
cd boost_1_70_0
44+
wget https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
45+
tar -xzf boost_1_73_0.tar.gz
46+
cd boost_1_73_0
4747
./bootstrap.sh
4848
./b2 headers
4949
./b2 -j<Num Parallel>
@@ -52,7 +52,7 @@ cd boost_1_70_0
5252
-~/.bashrc 文件中保存 BOOST_ROOT 环境变量
5353

5454
```bash
55-
export BOOST_ROOT=/home/dbliu/work/chainSQL/Builds/Ubuntu/boost_1_70_0
55+
export BOOST_ROOT=/home/dbliu/work/chainSQL/Builds/Ubuntu/boost_1_73_0
5656
```
5757
- 让 BOOST_ROOT 环境变量生效
5858
```bash

Builds/macos/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ brew install git cmake pkg-config protobuf openssl mysql-client@5.7
6161

6262
### Build Boost
6363

64-
Boost 1.70 or later is required.
64+
Boost 1.73 or later is required.
6565

6666
We want to compile boost with clang/libc++
6767

68-
Download [a release](https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2)
68+
Download [a release](https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz)
6969

7070
Extract it to a folder, making note of where, open a terminal, then:
7171

@@ -87,11 +87,11 @@ If you didn't persistently set the `BOOST_ROOT` environment variable to the
8787
root of the extracted directory above, then you should set it temporarily.
8888

8989
For example, assuming your username were `Abigail` and you extracted Boost
90-
1.70.0 in `/Users/Abigail/Downloads/boost_1_70_0`, you would do for any
90+
1.73.0 in `/Users/Abigail/Downloads/boost_1_73_0`, you would do for any
9191
shell in which you want to build:
9292

9393
```
94-
echo 'export BOOST_ROOT=/Users/Abigail/Downloads/boost_1_70_0' >> ~/.zshrc
94+
echo 'export BOOST_ROOT=/Users/Abigail/Downloads/boost_1_73_0' >> ~/.zshrc
9595
```
9696

9797
You need to specify the mysql-client lib path for `MYSQL_DIR` environment variable.

src/eth/vm/Common.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ namespace eth {
1919
bytes const NullBytes;
2020

2121
using bigint = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<>>;
22-
//using u256 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
22+
using u256 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
23+
using s256 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<256, 256,
24+
boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void>>;
2325

2426
struct Exception : virtual std::exception, virtual boost::exception
2527
{

src/eth/vm/ExtVMFace.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -263,23 +263,23 @@ namespace eth {
263263
evmcResult.output_data = result.output.data();
264264
evmcResult.output_size = result.output.size();
265265

266-
#ifdef DEBUG
267-
if (evmcResult.output_size) {
268-
// fix an issue that Stack around the variable 'result' was corrupted
269-
evmc_get_optional_storage(&evmcResult)->pointer = std::malloc(evmcResult.output_size);
270-
new(evmc_get_optional_storage(&evmcResult)->pointer) bytes(result.output.takeBytes());
271-
272-
evmcResult.release = [](evmc_result const* _result)
273-
{
274-
uint8_t* data = (uint8_t*)evmc_get_const_optional_storage(_result)->pointer;
275-
auto& output = reinterpret_cast<bytes const&>(*data);
276-
// Explicitly call vector's destructor to release its data.
277-
// This is normal pattern when placement new operator is used.
278-
output.~bytes();
279-
std::free(data);
280-
};
281-
}
282-
#else
266+
//#ifdef DEBUG
267+
// if (evmcResult.output_size) {
268+
// // fix an issue that Stack around the variable 'result' was corrupted
269+
// evmc_get_optional_storage(&evmcResult)->pointer = std::malloc(evmcResult.output_size);
270+
// new(evmc_get_optional_storage(&evmcResult)->pointer) bytes(result.output.takeBytes());
271+
//
272+
// evmcResult.release = [](evmc_result const* _result)
273+
// {
274+
// uint8_t* data = (uint8_t*)evmc_get_const_optional_storage(_result)->pointer;
275+
// auto& output = reinterpret_cast<bytes const&>(*data);
276+
// // Explicitly call vector's destructor to release its data.
277+
// // This is normal pattern when placement new operator is used.
278+
// output.~bytes();
279+
// std::free(data);
280+
// };
281+
// }
282+
//#else
283283
// Place a new vector of bytes containing output in result's reserved memory.
284284
auto* data = evmc_get_optional_storage(&evmcResult);
285285
//static_assert(sizeof(bytes) <= sizeof(*data), "Vector is too big");
@@ -294,7 +294,7 @@ namespace eth {
294294
// This is normal pattern when placement new operator is used.
295295
output.~bytes();
296296
};
297-
#endif
297+
//#endif
298298
return evmc::result{ evmcResult };
299299
}
300300

src/eth/vm/utils/keccak.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,9 @@ void keccak(uint8_t const* _data, uint64_t _size, uint8_t* o_hash)
154154
keccak_256(o_hash, 32, _data, _size);
155155
}
156156

157-
}
157+
void sha3(uint8_t const* _data, uint64_t _size, uint8_t* o_hash)
158+
{
159+
keccak_256(o_hash, 32, _data, _size);
160+
}
161+
162+
}

0 commit comments

Comments
 (0)