Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5622 from EOSIO/release/1.2.x
Browse files Browse the repository at this point in the history
Release 1.2.5
  • Loading branch information
b1bart authored Sep 11, 2018
2 parents cc9decf + d9e874e commit 08819aa
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 76 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 2)
set(VERSION_PATCH 4)
set(VERSION_PATCH 5)

set( CLI_CLIENT_EXECUTABLE_NAME cleos )
set( NODE_EXECUTABLE_NAME nodeos )
Expand Down
4 changes: 2 additions & 2 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cd eos/Docker
docker build . -t eosio/eos
```

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:
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:

```bash
docker build -t eosio/eos:v1.2.4 --build-arg branch=v1.2.4 .
docker build -t eosio/eos:v1.2.5 --build-arg branch=v1.2.5 .
```

By default, the symbol in eosio.system is set to SYS. You can override this using the symbol argument while building the docker image.
Expand Down
14 changes: 0 additions & 14 deletions Docker/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ RUN git clone --depth 1 --single-branch --branch release_40 https://github.com/l
&& cmake --build build --target install \
&& cd .. && rm -rf llvm

RUN wget https://github.com/WebAssembly/binaryen/archive/1.37.21.tar.gz -O - | tar -xz \
&& cd binaryen-1.37.21 \
&& cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --target install \
&& cd .. && rm -rf binaryen-1.37.21

RUN git clone --depth 1 https://github.com/cryptonomex/secp256k1-zkp \
&& cd secp256k1-zkp \
&& ./autogen.sh \
Expand All @@ -69,11 +63,3 @@ RUN git clone --depth 1 -b releases/v3.3 https://github.com/mongodb/mongo-cxx-dr
&& make -j$(nproc) \
&& make install \
&& cd ../../ && rm -rf mongo-cxx-driver

RUN git clone --depth 1 --single-branch --branch master https://github.com/ucb-bar/berkeley-softfloat-3.git \
&& cd berkeley-softfloat-3/build/Linux-x86_64-GCC \
&& make -j${nproc} SPECIALIZE_TYPE="8086-SSE" SOFTFLOAT_OPS="-DSOFTFLOAT_ROUND_EVEN -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32" \
&& mkdir -p /opt/berkeley-softfloat-3 && cp softfloat.a /opt/berkeley-softfloat-3/libsoftfloat.a \
&& mv ../../source/include /opt/berkeley-softfloat-3/include && cd - && rm -rf berkeley-softfloat-3

ENV SOFTFLOAT_ROOT /opt/berkeley-softfloat-3
4 changes: 4 additions & 0 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,10 @@ void controller::drop_unapplied_transaction(const transaction_metadata_ptr& trx)
my->unapplied_transactions.erase(trx->signed_id);
}

void controller::drop_all_unapplied_transactions() {
my->unapplied_transactions.clear();
}

vector<transaction_id_type> controller::get_scheduled_transactions() const {
const auto& idx = db().get_index<generated_transaction_multi_index,by_delay>();

Expand Down
1 change: 1 addition & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ namespace eosio { namespace chain {
*/
vector<transaction_metadata_ptr> get_unapplied_transactions() const;
void drop_unapplied_transaction(const transaction_metadata_ptr& trx);
void drop_all_unapplied_transactions();

/**
* These transaction IDs represent transactions available in the head chain state as scheduled
Expand Down
2 changes: 1 addition & 1 deletion libraries/chainbase
Submodule chainbase updated 1 files
+0 −24 src/chainbase.cpp
116 changes: 58 additions & 58 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ using transaction_id_with_expiry_index = multi_index_container<
>
>;



enum class pending_block_mode {
producing,
speculating
Expand Down Expand Up @@ -878,6 +876,13 @@ fc::time_point producer_plugin_impl::calculate_pending_block_time() const {
return block_time;
}

enum class tx_category {
PERSISTED,
UNEXPIRED_UNPERSISTED,
EXPIRED,
};


producer_plugin_impl::start_block_result producer_plugin_impl::start_block(bool &last_block) {
chain::controller& chain = app().get_plugin<chain_plugin>().chain();

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

if (!persisted_by_expiry.empty() || _pending_block_mode == pending_block_mode::producing) {
auto unapplied_trxs = chain.get_unapplied_transactions();

if (!persisted_by_expiry.empty()) {
for (auto itr = unapplied_trxs.begin(); itr != unapplied_trxs.end(); ++itr) {
const auto& trx = *itr;
if (persisted_by_id.find(trx->id) != persisted_by_id.end()) {
// this is a persisted transaction, push it into the block (even if we are speculating) with
// no deadline as it has already passed the subjective deadlines once and we want to represent
// the state of the chain including this transaction
try {
chain.push_transaction(trx, fc::time_point::maximum());
} catch ( const guard_exception& e ) {
app().get_plugin<chain_plugin>().handle_guard_exception(e);
return start_block_result::failed;
} FC_LOG_AND_DROP();

// remove it from further consideration as it is applied
*itr = nullptr;
}
}
}

if (_pending_block_mode == pending_block_mode::producing) {
for (const auto& trx : unapplied_trxs) {
if (block_time <= fc::time_point::now()) exhausted = true;
if (exhausted) {
break;
}
// Processing unapplied transactions...
//
if (_producers.empty() && persisted_by_id.empty()) {
// if this node can never produce and has no persisted transactions,
// there is no need for unapplied transactions they can be dropped
chain.drop_all_unapplied_transactions();
} else {
std::vector<transaction_metadata_ptr> apply_trxs;
{ // derive appliable transactions from unapplied_transactions and drop droppable transactions
auto unapplied_trxs = chain.get_unapplied_transactions();
apply_trxs.reserve(unapplied_trxs.size());

if (!trx) {
// nulled in the loop above, skip it
continue;
auto calculate_transaction_category = [&](const transaction_metadata_ptr& trx) {
if (trx->packed_trx.expiration() < pbs->header.timestamp.to_time_point()) {
return tx_category::EXPIRED;
} else if (persisted_by_id.find(trx->id) != persisted_by_id.end()) {
return tx_category::PERSISTED;
} else {
return tx_category::UNEXPIRED_UNPERSISTED;
}
};

if (trx->packed_trx.expiration() < pbs->header.timestamp.to_time_point()) {
// expired, drop it
for (auto& trx: unapplied_trxs) {
auto category = calculate_transaction_category(trx);
if (category == tx_category::EXPIRED || (category == tx_category::UNEXPIRED_UNPERSISTED && _producers.empty())) {
chain.drop_unapplied_transaction(trx);
continue;
} else if (category == tx_category::PERSISTED || (category == tx_category::UNEXPIRED_UNPERSISTED && _pending_block_mode == pending_block_mode::producing)) {
apply_trxs.emplace_back(std::move(trx));
}
}
}

try {
auto deadline = fc::time_point::now() + fc::milliseconds(_max_transaction_time_ms);
bool deadline_is_subjective = false;
if (_max_transaction_time_ms < 0 || (_pending_block_mode == pending_block_mode::producing && block_time < deadline)) {
deadline_is_subjective = true;
deadline = block_time;
}
for (const auto& trx: apply_trxs) {
if (block_time <= fc::time_point::now()) exhausted = true;
if (exhausted) {
break;
}

auto trace = chain.push_transaction(trx, deadline);
if (trace->except) {
if (failure_is_subjective(*trace->except, deadline_is_subjective)) {
exhausted = true;
} else {
// this failed our configured maximum transaction time, we don't want to replay it
chain.drop_unapplied_transaction(trx);
}
try {
auto deadline = fc::time_point::now() + fc::milliseconds(_max_transaction_time_ms);
bool deadline_is_subjective = false;
if (_max_transaction_time_ms < 0 || (_pending_block_mode == pending_block_mode::producing && block_time < deadline)) {
deadline_is_subjective = true;
deadline = block_time;
}

auto trace = chain.push_transaction(trx, deadline);
if (trace->except) {
if (failure_is_subjective(*trace->except, deadline_is_subjective)) {
exhausted = true;
} else {
// this failed our configured maximum transaction time, we don't want to replay it
chain.drop_unapplied_transaction(trx);
}
} catch ( const guard_exception& e ) {
app().get_plugin<chain_plugin>().handle_guard_exception(e);
return start_block_result::failed;
} FC_LOG_AND_DROP();
}
}
} catch ( const guard_exception& e ) {
app().get_plugin<chain_plugin>().handle_guard_exception(e);
return start_block_result::failed;
} FC_LOG_AND_DROP();
}

}

if (_pending_block_mode == pending_block_mode::producing) {
Expand Down

0 comments on commit 08819aa

Please sign in to comment.