Skip to content

Commit

Permalink
Merge pull request #2019 from AntelopeIO/merge-main-12-22-2023
Browse files Browse the repository at this point in the history
IF: Merge main 12-22-2023
  • Loading branch information
heifner authored Dec 27, 2023
2 parents f5d14f6 + f4f9e32 commit cdd7aaf
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 23 deletions.
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

0 comments on commit cdd7aaf

Please sign in to comment.