Skip to content

Commit 08819aa

Browse files
authored
Merge pull request #5622 from EOSIO/release/1.2.x
Release 1.2.5
2 parents cc9decf + d9e874e commit 08819aa

File tree

7 files changed

+67
-76
lines changed

7 files changed

+67
-76
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set( CXX_STANDARD_REQUIRED ON)
2727

2828
set(VERSION_MAJOR 1)
2929
set(VERSION_MINOR 2)
30-
set(VERSION_PATCH 4)
30+
set(VERSION_PATCH 5)
3131

3232
set( CLI_CLIENT_EXECUTABLE_NAME cleos )
3333
set( NODE_EXECUTABLE_NAME nodeos )

Docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ cd eos/Docker
2020
docker build . -t eosio/eos
2121
```
2222

23-
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.2.4 tag, you could do the following:
23+
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.2.5 tag, you could do the following:
2424

2525
```bash
26-
docker build -t eosio/eos:v1.2.4 --build-arg branch=v1.2.4 .
26+
docker build -t eosio/eos:v1.2.5 --build-arg branch=v1.2.5 .
2727
```
2828

2929
By default, the symbol in eosio.system is set to SYS. You can override this using the symbol argument while building the docker image.

Docker/builder/Dockerfile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ RUN git clone --depth 1 --single-branch --branch release_40 https://github.com/l
5050
&& cmake --build build --target install \
5151
&& cd .. && rm -rf llvm
5252

53-
RUN wget https://github.com/WebAssembly/binaryen/archive/1.37.21.tar.gz -O - | tar -xz \
54-
&& cd binaryen-1.37.21 \
55-
&& cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release \
56-
&& cmake --build build --target install \
57-
&& cd .. && rm -rf binaryen-1.37.21
58-
5953
RUN git clone --depth 1 https://github.com/cryptonomex/secp256k1-zkp \
6054
&& cd secp256k1-zkp \
6155
&& ./autogen.sh \
@@ -69,11 +63,3 @@ RUN git clone --depth 1 -b releases/v3.3 https://github.com/mongodb/mongo-cxx-dr
6963
&& make -j$(nproc) \
7064
&& make install \
7165
&& cd ../../ && rm -rf mongo-cxx-driver
72-
73-
RUN git clone --depth 1 --single-branch --branch master https://github.com/ucb-bar/berkeley-softfloat-3.git \
74-
&& cd berkeley-softfloat-3/build/Linux-x86_64-GCC \
75-
&& make -j${nproc} SPECIALIZE_TYPE="8086-SSE" SOFTFLOAT_OPS="-DSOFTFLOAT_ROUND_EVEN -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32" \
76-
&& mkdir -p /opt/berkeley-softfloat-3 && cp softfloat.a /opt/berkeley-softfloat-3/libsoftfloat.a \
77-
&& mv ../../source/include /opt/berkeley-softfloat-3/include && cd - && rm -rf berkeley-softfloat-3
78-
79-
ENV SOFTFLOAT_ROOT /opt/berkeley-softfloat-3

libraries/chain/controller.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,10 @@ void controller::drop_unapplied_transaction(const transaction_metadata_ptr& trx)
17441744
my->unapplied_transactions.erase(trx->signed_id);
17451745
}
17461746

1747+
void controller::drop_all_unapplied_transactions() {
1748+
my->unapplied_transactions.clear();
1749+
}
1750+
17471751
vector<transaction_id_type> controller::get_scheduled_transactions() const {
17481752
const auto& idx = db().get_index<generated_transaction_multi_index,by_delay>();
17491753

libraries/chain/include/eosio/chain/controller.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ namespace eosio { namespace chain {
107107
*/
108108
vector<transaction_metadata_ptr> get_unapplied_transactions() const;
109109
void drop_unapplied_transaction(const transaction_metadata_ptr& trx);
110+
void drop_all_unapplied_transactions();
110111

111112
/**
112113
* These transaction IDs represent transactions available in the head chain state as scheduled

libraries/chainbase

plugins/producer_plugin/producer_plugin.cpp

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ using transaction_id_with_expiry_index = multi_index_container<
8080
>
8181
>;
8282

83-
84-
8583
enum class pending_block_mode {
8684
producing,
8785
speculating
@@ -878,6 +876,13 @@ fc::time_point producer_plugin_impl::calculate_pending_block_time() const {
878876
return block_time;
879877
}
880878

879+
enum class tx_category {
880+
PERSISTED,
881+
UNEXPIRED_UNPERSISTED,
882+
EXPIRED,
883+
};
884+
885+
881886
producer_plugin_impl::start_block_result producer_plugin_impl::start_block(bool &last_block) {
882887
chain::controller& chain = app().get_plugin<chain_plugin>().chain();
883888

@@ -978,71 +983,66 @@ producer_plugin_impl::start_block_result producer_plugin_impl::start_block(bool
978983
try {
979984
size_t orig_pending_txn_size = _pending_incoming_transactions.size();
980985

981-
if (!persisted_by_expiry.empty() || _pending_block_mode == pending_block_mode::producing) {
982-
auto unapplied_trxs = chain.get_unapplied_transactions();
983-
984-
if (!persisted_by_expiry.empty()) {
985-
for (auto itr = unapplied_trxs.begin(); itr != unapplied_trxs.end(); ++itr) {
986-
const auto& trx = *itr;
987-
if (persisted_by_id.find(trx->id) != persisted_by_id.end()) {
988-
// this is a persisted transaction, push it into the block (even if we are speculating) with
989-
// no deadline as it has already passed the subjective deadlines once and we want to represent
990-
// the state of the chain including this transaction
991-
try {
992-
chain.push_transaction(trx, fc::time_point::maximum());
993-
} catch ( const guard_exception& e ) {
994-
app().get_plugin<chain_plugin>().handle_guard_exception(e);
995-
return start_block_result::failed;
996-
} FC_LOG_AND_DROP();
997-
998-
// remove it from further consideration as it is applied
999-
*itr = nullptr;
1000-
}
1001-
}
1002-
}
1003-
1004-
if (_pending_block_mode == pending_block_mode::producing) {
1005-
for (const auto& trx : unapplied_trxs) {
1006-
if (block_time <= fc::time_point::now()) exhausted = true;
1007-
if (exhausted) {
1008-
break;
1009-
}
986+
// Processing unapplied transactions...
987+
//
988+
if (_producers.empty() && persisted_by_id.empty()) {
989+
// if this node can never produce and has no persisted transactions,
990+
// there is no need for unapplied transactions they can be dropped
991+
chain.drop_all_unapplied_transactions();
992+
} else {
993+
std::vector<transaction_metadata_ptr> apply_trxs;
994+
{ // derive appliable transactions from unapplied_transactions and drop droppable transactions
995+
auto unapplied_trxs = chain.get_unapplied_transactions();
996+
apply_trxs.reserve(unapplied_trxs.size());
1010997

1011-
if (!trx) {
1012-
// nulled in the loop above, skip it
1013-
continue;
998+
auto calculate_transaction_category = [&](const transaction_metadata_ptr& trx) {
999+
if (trx->packed_trx.expiration() < pbs->header.timestamp.to_time_point()) {
1000+
return tx_category::EXPIRED;
1001+
} else if (persisted_by_id.find(trx->id) != persisted_by_id.end()) {
1002+
return tx_category::PERSISTED;
1003+
} else {
1004+
return tx_category::UNEXPIRED_UNPERSISTED;
10141005
}
1006+
};
10151007

1016-
if (trx->packed_trx.expiration() < pbs->header.timestamp.to_time_point()) {
1017-
// expired, drop it
1008+
for (auto& trx: unapplied_trxs) {
1009+
auto category = calculate_transaction_category(trx);
1010+
if (category == tx_category::EXPIRED || (category == tx_category::UNEXPIRED_UNPERSISTED && _producers.empty())) {
10181011
chain.drop_unapplied_transaction(trx);
1019-
continue;
1012+
} else if (category == tx_category::PERSISTED || (category == tx_category::UNEXPIRED_UNPERSISTED && _pending_block_mode == pending_block_mode::producing)) {
1013+
apply_trxs.emplace_back(std::move(trx));
10201014
}
1015+
}
1016+
}
10211017

1022-
try {
1023-
auto deadline = fc::time_point::now() + fc::milliseconds(_max_transaction_time_ms);
1024-
bool deadline_is_subjective = false;
1025-
if (_max_transaction_time_ms < 0 || (_pending_block_mode == pending_block_mode::producing && block_time < deadline)) {
1026-
deadline_is_subjective = true;
1027-
deadline = block_time;
1028-
}
1018+
for (const auto& trx: apply_trxs) {
1019+
if (block_time <= fc::time_point::now()) exhausted = true;
1020+
if (exhausted) {
1021+
break;
1022+
}
10291023

1030-
auto trace = chain.push_transaction(trx, deadline);
1031-
if (trace->except) {
1032-
if (failure_is_subjective(*trace->except, deadline_is_subjective)) {
1033-
exhausted = true;
1034-
} else {
1035-
// this failed our configured maximum transaction time, we don't want to replay it
1036-
chain.drop_unapplied_transaction(trx);
1037-
}
1024+
try {
1025+
auto deadline = fc::time_point::now() + fc::milliseconds(_max_transaction_time_ms);
1026+
bool deadline_is_subjective = false;
1027+
if (_max_transaction_time_ms < 0 || (_pending_block_mode == pending_block_mode::producing && block_time < deadline)) {
1028+
deadline_is_subjective = true;
1029+
deadline = block_time;
1030+
}
1031+
1032+
auto trace = chain.push_transaction(trx, deadline);
1033+
if (trace->except) {
1034+
if (failure_is_subjective(*trace->except, deadline_is_subjective)) {
1035+
exhausted = true;
1036+
} else {
1037+
// this failed our configured maximum transaction time, we don't want to replay it
1038+
chain.drop_unapplied_transaction(trx);
10381039
}
1039-
} catch ( const guard_exception& e ) {
1040-
app().get_plugin<chain_plugin>().handle_guard_exception(e);
1041-
return start_block_result::failed;
1042-
} FC_LOG_AND_DROP();
1043-
}
1040+
}
1041+
} catch ( const guard_exception& e ) {
1042+
app().get_plugin<chain_plugin>().handle_guard_exception(e);
1043+
return start_block_result::failed;
1044+
} FC_LOG_AND_DROP();
10441045
}
1045-
10461046
}
10471047

10481048
if (_pending_block_mode == pending_block_mode::producing) {

0 commit comments

Comments
 (0)