This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Populate legacy block's state from database instead of executing transactions #5792
Populate legacy block's state from database instead of executing transactions #5792
Changes from all commits
44c2234
253489d
c54a1fd
dccb09f
6c9ab13
155cd8a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did it fill
m_transactions
,m_transactionsSet
,m_currentTxs
,m_currentUncles
before?I suspect these are also useful only for mining, and RPC methods get them separately from
BlockChain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question 😀
m_transactions
&m_transactionsSet
: Yesm_currentTxs
&m_currentUncles
: NoSo you raise a good question - can we assume that this function will only be called via RPC? I populated everything in the block because
populateFromChain
is a public function so it can be called by anyone...unless these fields are only usable in very specific situations (e.g. mining), perhaps we should fork thepopulateFromChain
into two functions - 1 which populates the fields which are useful in most cases and another which populates the rest?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think ideally these different cases should be handled somehow by different classes.
But let's not complicate it here, I think I'm fine with leaving like this.
But
m_currentTxs
really looks to be specific to onlycommitToSeal
andsealBlock
methods, and I think it would be fine to not copy it here.m_currentUncles
probably too.