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

Use transaction delay_sec in get_required_keys determination #5291

Merged
merged 15 commits into from
Aug 22, 2018

Conversation

heifner
Copy link
Contributor

@heifner heifner commented Aug 16, 2018

Resolves #5281

  • Use the transaction delay_sec in the determination of required keys.-

conr2d and others added 7 commits August 15, 2018 12:58
Fix typos in contracts/eosiolib/types.h documentation
#4972 created a different calling path into `producer_plugin_impl::calculate_next_block_time` where there was no pending block state.  As a result when the following conditions were met the code would dereference a null ptr:

* the node was a producer, who _had_ produced during this processes lifetime OR replayed a block where they produced (so they have watermark data)
* still in the active schedule of producers
* experienced a gap in blocks of > 5 seconds (so they moved to our “waiting” mode)

Credit goes to @heifner for the find
…roducer

Fix for nullptr deref when producers are waiting
@heifner heifner requested a review from arhag August 16, 2018 21:16
@jjnetcn
Copy link
Contributor

jjnetcn commented Aug 17, 2018

pretty_input.delay_sec is unsigned_int transacton::delay_sec;
get_required_keys param provided_delay is fc::microseconds.
it will cast thought
template
unsigned_int::operator T() const { return static_cast(value); } with T = fc::microseconds,
and static_cast call explicit fc::microseconds::microseconds(int64_t c) to set member variable _count to c.

so, call inline function fc::seconds(pretty_input.delay_sec) to replace pretty_input.delay_sec,
set _count=delay_sec*1000000

Copy link
Contributor

@wanderingbort wanderingbort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there was accidental drive in the fc submodule. Also, I'm going to rebase this to release/1.2.x so that it can be included as a bugfix in a patch release (it does seem like a bug)

@wanderingbort wanderingbort dismissed their stale review August 22, 2018 20:29

totally wrong

@heifner
Copy link
Contributor Author

heifner commented Aug 22, 2018

Although not strictly needed for the this change the fc submodule update was intentional for the changes to varint.hpp.

@heifner heifner changed the base branch from develop to release/1.2.x August 22, 2018 21:05
@wanderingbort wanderingbort merged commit 81c88f7 into release/1.2.x Aug 22, 2018
@wanderingbort wanderingbort deleted the gh#5281-required-keys-delay branch August 22, 2018 21:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants