-
Notifications
You must be signed in to change notification settings - Fork 40
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
Enhancement/skaled 1583 patch architecture plus 17.2 #1868
Enhancement/skaled 1583 patch architecture plus 17.2 #1868
Conversation
…-1583-patch-architecture-plus-17.2
SUGGESTIONS BEFORE MERGE:
|
@@ -91,12 +91,13 @@ std::pair< bool, ExecutionResult > ClientBase::estimateGasStep( int64_t _gas, Bl | |||
t.forceSender( _from ); | |||
t.forceChainId( chainId() ); | |||
t.ignoreExternalGas(); | |||
EnvInfo const env( _latestBlock.info(), bc().lastBlockHashes(), 0, _gas ); | |||
EnvInfo const env( _pendingBlock.info(), bc().lastBlockHashes(), | |||
_pendingBlock.previousInfo().timestamp(), 0, _gas ); |
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.
Mb _pendingBlock.previousInfo().timestamp()
-> _latestBlock.info().timestamp()
would be better?
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.
same
libethereum/ClientBase.cpp
Outdated
int64_t lowerBound = CorrectForkInPowPatch::isEnabledInWorkingBlock() ? | ||
Transaction::baseGasRequired( !_dest, &_data, | ||
bc().sealEngine()->chainParams().makeEvmSchedule( | ||
bc().info().timestamp(), bc().number() ) ) : | ||
Transaction::baseGasRequired( !_dest, &_data, EVMSchedule() ); |
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.
if/else would be more readable here
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.
👍
libethereum/SkaleHost.cpp
Outdated
static_cast< const Interface& >( m_client ) | ||
.blockInfo( LatestBlock ) | ||
.timestamp(), |
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.
This call could be retrieved and executed before loop
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.
👌
libethereum/SkaleHost.cpp
Outdated
@@ -653,7 +654,8 @@ void SkaleHost::createBlock( const ConsensusExtFace::transactions_vector& _appro | |||
// TODO clear occasionally this cache?! | |||
if ( m_m_transaction_cache.find( sha.asArray() ) != m_m_transaction_cache.cend() ) { | |||
Transaction t = m_m_transaction_cache.at( sha.asArray() ); | |||
t.checkOutExternalGas( m_client.chainParams(), m_client.number(), true ); | |||
t.checkOutExternalGas( m_client.chainParams(), | |||
m_client.blockInfo( LatestBlock ).timestamp(), m_client.number(), true ); |
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.
m_client.blockInfo( LatestBlock ).timestamp()
can be executed before loop
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.
👍
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.
Please remove exclamation marks and dead code
fixes #1583
Description
Tests
Tests for patches:
JsonRpcSuite/simple_contract
Performance Impact
There can be significant performance impact, as patch activations are evaluated at each block or sometimes even every transaction. Quick testing with stability tests (skale-ci-intergration_tests) showed no significant difference between 3.19.0-develop-latest and 3.19.0-develop.3
Details about changes in code
blockNumber
parameter now need alsocommittedBlockTimestamp
.EVMSchedule
can now be constructed from several patches, and not only taken from pre-defined list as before (ChainOperationParams::evmSchedule
)SealEngine
toChainOperationParams
, andSealEngine
is now unneeded in some places, whereChainOperationParams
suffice - for simplification of architecture. Also it's planned to cut out SealEngine completely.PushZeroPatch
uses boolean field inEVMSchedule
, and generates new EVMSchedule similar to 'fork blocks'libethereum/SchainPatch.h
there are new macros for creation of patches.SchainPatch
class.