Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IF: Merge main 12-22-2023 #2019

Merged
merged 25 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3c6c13a
bump chainbase submod to alloc/delete/free fix
spoonincode Dec 11, 2023
4624f25
bump chainbase submod to leap-5.0 HEAD w/ alloc/delete/free fix
spoonincode Dec 13, 2023
d874bda
Add an on_except so named_thread_pool does not terminate
heifner Dec 17, 2023
af1cd34
Merge remote-tracking branch 'origin/release/5.0' into trx-generator-…
heifner Dec 19, 2023
a469b69
Merge pull request #2000 from AntelopeIO/trx-generator-core-5.0
heifner Dec 19, 2023
468aad6
GH-2006 Do not attempt to apply blocks <= LIB
heifner Dec 20, 2023
028bd49
Merge pull request #2002 from AntelopeIO/trx-generator-core-main
heifner Dec 20, 2023
6539271
GH-2006 Check for unlinkable blocks while syncing
heifner Dec 20, 2023
89e2db1
Merge pull request #2007 from AntelopeIO/GH-2006-unlinkable-blocks-5.0
heifner Dec 20, 2023
0941a88
Merge branch 'release/5.0' into GH-2006-test-no-block-log-sync
heifner Dec 20, 2023
0fb49ec
Merge remote-tracking branch 'origin/release/5.0' into GH-2006-unlink…
heifner Dec 20, 2023
952aedf
Merge pull request #2009 from AntelopeIO/GH-2006-unlinkable-blocks-main
heifner Dec 20, 2023
4becdd5
Merge pull request #2008 from AntelopeIO/GH-2006-test-no-block-log-sync
heifner Dec 20, 2023
54633f0
Merge remote-tracking branch 'origin/release/5.0' into GH-2006-test-n…
heifner Dec 20, 2023
fddc8ed
GH-2006 Search for more precise error and provide a bit more tolerance
heifner Dec 21, 2023
debef7f
Merge pull request #2015 from AntelopeIO/GH-2006-fix-test-5.0
heifner Dec 21, 2023
c8920c3
Merge remote-tracking branch 'origin/release/5.0' into GH-2006-test-n…
heifner Dec 21, 2023
1f118d3
Merge pull request #2014 from AntelopeIO/GH-2006-test-no-block-log-sy…
heifner Dec 21, 2023
574f430
Merge pull request #1978 from AntelopeIO/cb_alloc_delete_free_fix_5x
spoonincode Dec 22, 2023
638d434
Merge remote-tracking branch 'origin/release/5.0' into HEAD
spoonincode Dec 22, 2023
3fdc354
switch to using reference-contracts in libtester tests
spoonincode Dec 22, 2023
46c575e
Merge pull request #2017 from AntelopeIO/cb_alloc_delete_free_fix
spoonincode Dec 22, 2023
4216ebe
Merge remote-tracking branch 'origin/main' into merge-main-12-22-2023
heifner Dec 22, 2023
86aaf51
Merge pull request #2018 from AntelopeIO/use_ref_contracts
spoonincode Dec 22, 2023
f4f9e32
Merge remote-tracking branch 'origin/main' into merge-main-12-22-2023
heifner Dec 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cicd/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target":"4",
"prerelease":false
},
"eossystemcontracts":{
"ref":"release/3.2"
"referencecontracts":{
"ref":"main"
}
}
32 changes: 16 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ on:
- default
- true
- false
override-eos-system-contracts:
description: 'Override eos-system-contracts ref'
override-reference-contracts:
description: 'Override reference contracts ref'
type: string

permissions:
Expand Down Expand Up @@ -57,26 +57,26 @@ jobs:
outputs:
cdt-target: ${{steps.versions.outputs.cdt-target}}
cdt-prerelease: ${{steps.versions.outputs.cdt-prerelease}}
eos-system-contracts-ref: ${{steps.versions.outputs.eos-system-contracts-ref}}
reference-contracts-ref: ${{steps.versions.outputs.reference-contracts-ref}}
steps:
- name: Setup cdt and eos-system-contracts versions
- name: Setup cdt and reference-contracts versions
id: versions
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
DEFAULTS_JSON=$(curl -sSfL $(gh api https://api.github.com/repos/${{github.repository}}/contents/.cicd/defaults.json?ref=${{github.sha}} --jq .download_url))
echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.target') >> $GITHUB_OUTPUT
echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.prerelease') >> $GITHUB_OUTPUT
echo eos-system-contracts-ref=$(echo "$DEFAULTS_JSON" | jq -r '.eossystemcontracts.ref') >> $GITHUB_OUTPUT
echo reference-contracts-ref=$(echo "$DEFAULTS_JSON" | jq -r '.referencecontracts.ref') >> $GITHUB_OUTPUT

if [[ "${{inputs.override-cdt}}" != "" ]]; then
echo cdt-target=${{inputs.override-cdt}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-cdt-prerelease}}" == +(true|false) ]]; then
echo cdt-prerelease=${{inputs.override-cdt-prerelease}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-eos-system-contracts}}" != "" ]]; then
echo eos-system-contracts-ref=${{inputs.override-eos-system-contracts}} >> $GITHUB_OUTPUT
if [[ "${{inputs.override-reference-contracts}}" != "" ]]; then
echo reference-contracts-ref=${{inputs.override-reference-contracts}} >> $GITHUB_OUTPUT
fi

package:
Expand Down Expand Up @@ -312,21 +312,21 @@ jobs:
rm ./*.deb

# Reference Contracts
- name: checkout eos-system-contracts
- name: checkout reference-contracts
uses: actions/checkout@v4
with:
repository: eosnetworkfoundation/eos-system-contracts
path: eos-system-contracts
ref: '${{needs.v.outputs.eos-system-contracts-ref}}'
repository: AntelopeIO/reference-contracts
path: reference-contracts
ref: '${{needs.v.outputs.reference-contracts-ref}}'
- if: ${{ matrix.test == 'deb-install' }}
name: Install eos-system-contracts deps
name: Install reference-contracts deps
run: |
apt-get -y install cmake build-essential
- name: Build & Test eos-system-contracts
- name: Build & Test reference-contracts
run: |
cmake -S eos-system-contracts -B eos-system-contracts/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DSYSTEM_ENABLE_LEAP_VERSION_CHECK=Off -DSYSTEM_ENABLE_CDT_VERSION_CHECK=Off
cmake --build eos-system-contracts/build -- -j $(nproc)
cd eos-system-contracts/build/tests
cmake -S reference-contracts -B reference-contracts/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DSYSTEM_ENABLE_LEAP_VERSION_CHECK=Off -DSYSTEM_ENABLE_CDT_VERSION_CHECK=Off
cmake --build reference-contracts/build -- -j $(nproc)
cd reference-contracts/build/tests
ctest --output-on-failure -j $(nproc)

all-passing:
Expand Down
2 changes: 1 addition & 1 deletion libraries/chainbase
11 changes: 9 additions & 2 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3086,7 +3086,7 @@ namespace eosio {
("h", my_impl->get_chain_head_num()));
if( !my_impl->sync_master->syncing_from_peer() ) { // guard against peer thinking it needs to send us old blocks
uint32_t lib_num = my_impl->get_chain_lib_num();
if( blk_num < lib_num ) {
if( blk_num <= lib_num ) {
fc::unique_lock g( conn_mtx );
const auto last_sent_lib = last_handshake_sent.last_irreversible_block_num;
g.unlock();
Expand All @@ -3103,6 +3103,13 @@ namespace eosio {
} else {
block_sync_bytes_received += message_length;
my_impl->sync_master->sync_recv_block(shared_from_this(), blk_id, blk_num, false);
uint32_t lib_num = my_impl->get_chain_lib_num();
if( blk_num <= lib_num ) {
cancel_wait();

pending_message_buffer.advance_read_ptr( message_length );
return true;
}
}

auto ds = pending_message_buffer.create_datastream();
Expand Down Expand Up @@ -3770,7 +3777,7 @@ namespace eosio {
connection_ptr c = shared_from_this();

try {
if( cc.fetch_block_by_id(blk_id) ) {
if( blk_num <= cc.last_irreversible_block_num() || cc.fetch_block_by_id(blk_id) ) {
c->strand.post( [sync_master = my_impl->sync_master.get(),
dispatcher = my_impl->dispatcher.get(), c, blk_id, blk_num]() {
dispatcher->add_peer_block( blk_id, c->connection_id );
Expand Down
11 changes: 10 additions & 1 deletion tests/nodeos_startup_catchup.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ def waitForNodeStarted(node):
waitForBlock(node0, catchupHead+5, timeout=twoRoundsTimeout*2, blockType=BlockType.lib)

Print("Restart catchup node")
catchupNode.relaunch()
addSwapFlags = None
if catchup_num % 3 == 0:
addSwapFlags = {"--block-log-retain-blocks": "0", "--delete-all": ""}
catchupNode.relaunch(skipGenesis=False, addSwapFlags=addSwapFlags)
waitForNodeStarted(catchupNode)
lastCatchupLibNum=lib(catchupNode)

Expand All @@ -189,6 +192,12 @@ def waitForNodeStarted(node):
catchupNode.interruptAndVerifyExitStatus(60)
catchupNode.popenProc=None

logFile = Utils.getNodeDataDir(catchupNodeNum) + "/stderr.txt"
f = open(logFile)
contents = f.read()
if contents.count("3030001 unlinkable_block_exception: Unlinkable block") > 10: # a few are fine
errorExit(f"Node{catchupNodeNum} has unlinkable blocks: {logFile}.")

testSuccessful=True

finally:
Expand Down
5 changes: 4 additions & 1 deletion tests/trx_generator/trx_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ namespace eosio::testing {
}

void provider_connection::init_and_connect() {
_connection_thread_pool.start(1, {});
_connection_thread_pool.start(1,
[&](const fc::exception &e) {
wlog("Exception in connection_thread: ${e}", ("e", e.to_detail_string()));
});
connect();
};

Expand Down