Skip to content

Commit ec8e90e

Browse files
committed
Merge remote-tracking branch 'remotes/origin/fierce_fermion_6.0RC' into testnet
2 parents a050481 + 46dc72b commit ec8e90e

File tree

11 files changed

+235
-111
lines changed

11 files changed

+235
-111
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,14 @@ jobs:
5151
run: |
5252
git clone --depth=1 https://github.com/BeamMW/libs.git c:/beam-libs
5353
echo "OPENSSL_ROOT_DIR=c:\beam-libs\openssl" >> $GITHUB_ENV
54+
git clone https://github.com/BeamMW/boost_prebuild_${{matrix.os}}.git c:/boost_prebuild
55+
echo "BOOST_ROOT=c:\boost_prebuild" >> $GITHUB_ENV
5456
55-
- name: Download boost
57+
- name: Download boost [ubuntu && macos]
58+
if: matrix.os != 'windows-2019'
5659
shell: bash
5760
run: |
5861
git clone --depth=1 https://github.com/BeamMW/boost_prebuild_${{matrix.os}}.git ${{runner.workspace}}/boost_prebuild
59-
60-
- name: Configure boost path [windows]
61-
shell: bash
62-
if: matrix.os == 'windows-2019'
63-
run: |
64-
echo "BOOST_ROOT=${{runner.workspace}}/boost_prebuild" >> $GITHUB_ENV
65-
66-
- name: Configure boost path [ununtu all]
67-
shell: bash
68-
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
69-
run: |
70-
echo "BOOST_INCLUDEDIR=${{runner.workspace}}/boost_prebuild/include" >> $GITHUB_ENV
71-
echo "BOOST_LIBRARYDIR=${{runner.workspace}}/boost_prebuild/lib/" >> $GITHUB_ENV
72-
73-
- name: Configure boost path [macos-10.15]
74-
shell: bash
75-
if: matrix.os == 'macos-10.15'
76-
run: |
7762
echo "BOOST_INCLUDEDIR=${{runner.workspace}}/boost_prebuild/include" >> $GITHUB_ENV
7863
echo "BOOST_LIBRARYDIR=${{runner.workspace}}/boost_prebuild/lib/" >> $GITHUB_ENV
7964

3rdparty/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ add_library(pbkdf STATIC
99
)
1010

1111
add_subdirectory(secp256k1-zkp)
12+
add_subdirectory(ethash)
1213
if (BEAM_ATOMIC_SWAP_SUPPORT)
13-
add_subdirectory(ethash)
1414
add_subdirectory(libbitcoin)
1515
endif()
1616
add_subdirectory(sqlite)

3rdparty/ethash/include/ethash/keccak.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#pragma once
77

8-
#include <ethash/hash_types.h>
8+
#include "hash_types.h"
99

1010
#include <stddef.h>
1111

bvm/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ add_library(bvm STATIC ${BVM_SRC})
1212
target_link_libraries(bvm
1313
PUBLIC
1414
core
15+
keccak
1516
)
1617

1718
if(BEAM_TESTS_ENABLED)

bvm/Shaders/dummy/contract.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,17 @@ export void Method_7(Dummy::Hash2& r)
120120

121121
export void Method_8(Dummy::Hash3& r)
122122
{
123-
HashObj* pHash = Env::HashCreateKeccak256();
123+
HashObj* pHash = Env::HashCreateKeccak(r.m_Bits);
124124
Env::Halt_if(!pHash);
125125

126-
Env::HashWrite(pHash, r.m_pInp, sizeof(r.m_pInp));
127-
Env::HashGetValue(pHash, r.m_pRes, sizeof(r.m_pRes));
126+
for (uint32_t nDone = 0; nDone < r.m_Inp; )
127+
{
128+
auto nPortion = std::min(r.m_NaggleBytes, r.m_Inp - nDone);
129+
Env::HashWrite(pHash, r.m_pInp + nDone, nPortion);
130+
nDone += nPortion;
131+
}
132+
133+
Env::HashGetValue(pHash, r.m_pRes, r.m_Bits / 8);
128134

129135
Env::HashFree(pHash);
130136
}

bvm/Shaders/dummy/contract.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ namespace Dummy
5555
{
5656
static const uint32_t s_iMethod = 8;
5757

58-
uint8_t m_pInp[15];
59-
uint8_t m_pRes[32];
58+
uint32_t m_Bits;
59+
uint32_t m_Inp;
60+
uint32_t m_NaggleBytes;
61+
uint8_t m_pInp[520];
62+
uint8_t m_pRes[64];
6063
};
6164

6265
struct VerifyBeamHeader

bvm/Shaders/dummy/contract.wasm

70 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)