-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip transaction size check while replaying #1716
Conversation
FC_ASSERT( head_block_time() <= HARDFORK_CORE_1573_TIME | ||
|| trx.get_packed_size() <= chain_parameters.maximum_transaction_size, | ||
"Transaction exceeds maximum transaction size." ); | ||
if ( !(skip & skip_block_size_check ) ) // don't waste time on replay |
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.
IMHO this code is wrong. skip_block_size_check
flag is set when pushing pending transactions, that means the large transactions will propagate and will accumulate in RAM.
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.
Ooff! I will test and attempt a different solution. Thanks for the catch.
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.
OK, I was wrong, was misled by the comment here:
bitshares-core/libraries/chain/db_block.cpp
Lines 215 to 224 in fa38ee4
/** | |
* Attempts to push the transaction into the pending queue | |
* | |
* When called to push a locally generated transaction, set the skip_block_size_check bit on the skip argument. This | |
* will allow the transaction to be pushed even if it causes the pending block size to exceed the maximum block size. | |
* Although the transaction will probably not propagate further now, as the peers are likely to have their pending | |
* queues full as well, it will be kept in the queue to be propagated later when a new block flushes out the pending | |
* queues. | |
*/ | |
processed_transaction database::push_transaction( const precomputable_transaction& trx, uint32_t skip ) |
Actually we didn't set the flag when pushing transactions to pending queue:
bitshares-core/libraries/app/application.cpp
Line 598 in fa38ee4
_chain_db->push_transaction( transaction_message.trx ); |
bitshares-core/libraries/app/api.cpp
Line 164 in fa38ee4
_app.chain_database()->push_transaction(trx); |
bitshares-core/libraries/app/api.cpp
Line 191 in fa38ee4
_app.chain_database()->push_transaction(trx); |
push_transaction
is called with default skip
parameter, aka skip_nothing
.
Checking the transaction size was added in v3.0.0, but is not needed when replaying. This PR skips the transaction size check while replaying.
Fixes #1619