Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7bfc8a9
#2442 fix read only in contract creation
olehnikolaiev Mar 20, 2026
d2648c5
#2442 fix read only during contract deployment
olehnikolaiev Mar 26, 2026
5a02d3a
#2442 format
olehnikolaiev Mar 26, 2026
f97c90b
Merge branch 'develop' into bug/2442-readonly-contract-deployment
olehnikolaiev Mar 31, 2026
7b2f107
Merge pull request #2452 from skalenetwork/bug/2442-readonly-contract…
DmytroNazarenko Apr 1, 2026
654af81
code cleanup
olehnikolaiev Apr 3, 2026
dc1281e
fix build
olehnikolaiev Apr 6, 2026
b63345c
fix build
olehnikolaiev Apr 6, 2026
8e756ee
fix historic build
olehnikolaiev Apr 21, 2026
aa1f7a9
lint tests/
olehnikolaiev Apr 22, 2026
e02a4a7
fix tests
olehnikolaiev Apr 23, 2026
7706d59
format
olehnikolaiev Apr 28, 2026
a5c9ff4
Merge pull request #2472 from skalenetwork/cleanup
DmytroNazarenko Apr 29, 2026
d7c45e7
fix merge conflicts v5.1.0 develop
PropzSaladaz Jun 5, 2026
31e3a54
fix merge conflicts v5.1.0 develop
PropzSaladaz Jun 8, 2026
56c7870
fix merge conflicts in jsonrpc tests
PropzSaladaz Jun 8, 2026
0f0be3c
remove duplicated ifdef preprocessor directives; add back removed cod…
PropzSaladaz Jun 11, 2026
f261281
move tx iterator increment to outside if condition when saving to DB
PropzSaladaz Jun 11, 2026
2344899
set bite_getCraftedCtxs to return json array in all paths to follow s…
PropzSaladaz Jun 11, 2026
bec07c9
format
PropzSaladaz Jun 11, 2026
7319d16
remove deleted test from v5.1.0
PropzSaladaz Jun 11, 2026
0a037e3
Merge pull request #2484 from skalenetwork/merge-v5.1.0-before-tx-dro…
PropzSaladaz Jun 12, 2026
8f2d6ee
merge develop - v5.2.0
PropzSaladaz Jun 15, 2026
2a9795b
Merge branch 'v5.2.0' into develop-to-v5.2.0
PropzSaladaz Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion libdevcore/OverlayDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ OverlayDB::~OverlayDB() = default;
void OverlayDB::commit() {
if ( m_db ) {
for ( unsigned commitTry = 0; commitTry < 10; ++commitTry ) {
// cnote << "Committing nodes to disk DB:";
#if DEV_GUARDED_DB
DEV_READ_GUARDED( x_this )
#endif
Expand Down
2 changes: 0 additions & 2 deletions libdevcore/RLP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ RLPStream& RLPStream::appendRaw( bytesConstRef _s, size_t _itemCount ) {
void RLPStream::noteAppended( size_t _itemCount ) {
if ( !_itemCount )
return;
// cdebug << "noteAppended(" << _itemCount << ")";
while ( m_listStack.size() ) {
if ( m_listStack.back().first < _itemCount )
BOOST_THROW_EXCEPTION( RLPException()
Expand Down Expand Up @@ -257,7 +256,6 @@ void RLPStream::noteAppended( size_t _itemCount ) {
}

RLPStream& RLPStream::appendList( size_t _items ) {
// cdebug << "appendList(" << _items << ")";
if ( _items )
m_listStack.push_back( std::make_pair( _items, m_out.size() ) );
else
Expand Down
2 changes: 1 addition & 1 deletion libdevcore/TransientDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TransientDirectory::~TransientDirectory() {
if ( !ec )
return;

// In some cases, antivirus runnig on Windows will scan all the newly created directories.
// In some cases, antivirus running on Windows will scan all the newly created directories.
// As a consequence, directory is locked and can not be deleted immediately.
// Retry after 10 milliseconds usually is successful.
// This will help our tests run smoothly in such environment.
Expand Down
9 changes: 0 additions & 9 deletions libdevcore/TrieDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ bytes GenericTrieDB< DB >::mergeAt(
}

auto sh = _k.shared( k );
// std::cout << _k << " sh " << k << " = " << sh << std::endl;
if ( sh ) {
// shared stuff - cleve at disagreement.
auto cleved = cleve( _orig, sh );
Expand Down Expand Up @@ -1059,11 +1058,6 @@ bool GenericTrieDB< DB >::deleteAtAux( RLPStream& _out, RLP const& _orig, Nibble
if ( !b.size() ) // not found - no change.
return false;

/* if (_orig.isList())
killNode(_orig);
else
killNode(_orig.toHash<h256>());*/

streamNode( _out, b );
return true;
}
Expand Down Expand Up @@ -1146,9 +1140,6 @@ bytes GenericTrieDB< DB >::graft( RLP const& _orig ) {
assert( n.itemCount() == 2 );

return rlpList( hexPrefixEncode( keyOf( _orig ), keyOf( n ), isLeaf( n ) ), n[1] );
// auto ret =
// std::cout << keyOf(_orig) << " ++ " << keyOf(n) << " == " << keyOf(RLP(ret)) << std::endl;
// return ret;
}

template < class DB >
Expand Down
3 changes: 0 additions & 3 deletions libethashseal/Ethash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ Ethash::Ethash() {
m_farm.setSealers( sealers );
m_farm.onSolutionFound( [this]( EthashProofOfWork::Solution const& sol ) {
std::unique_lock< Mutex > l( m_submitLock );
// cdebug << m_farm.work().seedHash << m_farm.work().headerHash << sol.nonce <<
// EthashAux::eval(m_farm.work().seedHash, m_farm.work().headerHash,
// sol.nonce).value;
setMixHash( m_sealing, sol.mixHash );
setNonce( m_sealing, sol.nonce );
if ( !quickVerifySeal( m_sealing ) )
Expand Down
2 changes: 0 additions & 2 deletions libethcore/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ inline void badBlock( bytes const& _header, std::string const& _err ) {
* @brief Describes the progress of a mining operation.
*/
struct WorkingProgress {
// MiningProgress& operator+=(MiningProgress const& _mp) { hashes += _mp.hashes; ms =
// std::max(ms, _mp.ms); return *this; }
uint64_t hashes = 0; ///< Total number of hashes computed.
uint64_t ms = 0; ///< Total number of milliseconds of mining thus far.
u256 rate() const { return ms == 0 ? 0 : hashes * 1000 / ms; }
Expand Down
3 changes: 0 additions & 3 deletions libethcore/EVMSchedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,12 @@ static const EVMSchedule IstanbulSchedule = [] {
schedule.extcodehashGas = 700;
schedule.haveChainID = true;
schedule.haveSelfbalance = true;
// schedule.eip2200Mode = true;
schedule.sstoreUnchangedGas = 800;
return schedule;
}();

static const EVMSchedule BerlinSchedule = [] {
EVMSchedule schedule = IstanbulSchedule;
// schedule.precompileStaticCallGas = 40;
// schedule.callSelfGas = 40;
return schedule;
}();

Expand Down
2 changes: 1 addition & 1 deletion libethcore/TransactionBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class TransactionBase {
#ifdef BITE
// called in TransactionBase constructor
// sets m_isBITETxn to true if a txn 'to' field
// maches BITE address
// matches BITE address
void checkIfBITETxnAndSet( const Address& _to );
#endif

Expand Down
29 changes: 2 additions & 27 deletions libethereum/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ Block::Block( BlockChain const& _bc, boost::filesystem::path const& _dbPath,
noteChain( _bc );
m_previousBlock.clear();
m_currentBlock.clear();
// assert(m_state.root() == m_previousBlock.stateRoot());
}

Block::Block( const BlockChain& _bc, h256 const& _hash, const State& _state, BaseState /*_bs*/,
Expand Down Expand Up @@ -141,9 +140,6 @@ Block::Block( const BlockChain& _bc, h256 const& _hash, const State& _state, Bas
if ( !bi.number() ) {
// Genesis required:
// We know there are no transactions, so just populate directly.

// m_state = State(m_state.accountStartNonce(), m_state.db(),
// BaseState::Empty); // TODO: try with PreExisting.
sync( _bc, _hash, bi );
} else {
auto parentHash = bi.parentHash();
Expand Down Expand Up @@ -298,8 +294,6 @@ PopulationStatistics Block::populateFromChain(
// Genesis required:
// We know there are no transactions, so just populate directly.
std::logic_error( "Not implemented" );
// m_state = State(m_state.accountStartNonce(), m_state.db(),
// BaseState::Empty); // TODO: try with PreExisting.
sync( _bc, _h, bi );
}

Expand Down Expand Up @@ -435,15 +429,13 @@ pair< TransactionReceipts, bool > Block::sync(
if ( !m_transactionSet.count( t.sha3() ) ) {
try {
if ( t.gasPrice() >= _gp.ask( *this ) ) {
// Timer t;
execute( _bc.lastBlockHashes(), t, Permanence::Uncommitted );
#ifdef FAIR
ret.first = m_receipts;
#else
ret.first.push_back( m_receipts.back() );
#endif
++goodTxs;
// cnote << "TX took:" << t.elapsed() * 1000;
} else if ( t.gasPrice() < _gp.ask( *this ) * 9 / 10 ) {
BOOST_LOG( m_loggerDebug )
<< t.sha3() << " Dropping El Cheapo transaction (<90% of ask price)";
Expand Down Expand Up @@ -479,7 +471,6 @@ pair< TransactionReceipts, bool > Block::sync(
<< t.sha3()
<< " Temporarily no gas left in current block (txs gas > "
"block's gas limit)";
//_tq.drop(t.sha3());
// Temporarily no gas left in current block.
// OPTIMISE: could note this and then we don't evaluate until a block that
// does have the gas left. for now, just leave alone.
Expand Down Expand Up @@ -978,9 +969,6 @@ u256 Block::enact( VerifiedBlockRef const& _block, BlockChain const& _bc ) {
m_currentBlock.noteDirty();
m_currentBlock = _block.info;

// cnote << "playback begins:" << m_currentBlock.hash() << "(without: " <<
// m_currentBlock.hash(WithoutSeal) << ")"; cnote << m_state;

RLP rlp( _block.block );

vector< bytes > receipts;
Expand Down Expand Up @@ -1024,7 +1012,6 @@ u256 Block::enact( VerifiedBlockRef const& _block, BlockChain const& _bc ) {
InvalidReceiptsStateRoot ex;
ex << Hash256RequirementError( m_currentBlock.receiptsRoot(), receiptsRoot );
ex << errinfo_receipts( receipts );
// ex << errinfo_vmtrace(vmTrace(_block.block, _bc, ImportRequirements::None));
for ( auto const& receipt : m_receipts ) {
if ( !receipt.hasStatusCode() ) {
BOOST_LOG( m_loggerWarning ) << "Skale does not support state root in receipt";
Expand Down Expand Up @@ -1153,16 +1140,6 @@ u256 Block::enact( VerifiedBlockRef const& _block, BlockChain const& _bc ) {
m_state.commit( removeEmptyAccounts ? dev::eth::CommitBehaviour::RemoveEmptyAccounts :
dev::eth::CommitBehaviour::KeepEmptyAccounts );

// // Hash the state trie and check against the state_root hash in m_currentBlock.
// if (m_currentBlock.stateRoot() != m_previousBlock.stateRoot() &&
// m_currentBlock.stateRoot() != globalRoot())
// {
// auto r = globalRoot();
// m_state.db().rollback(); // TODO: API in State for this?
// BOOST_THROW_EXCEPTION(
// InvalidStateRoot() << Hash256RequirementError(m_currentBlock.stateRoot(), r));
// }

return tdIncrease;
}

Expand Down Expand Up @@ -1268,7 +1245,7 @@ ExecutionResult Block::execute( LastBlockHashesFace const& _lh, Transaction cons

// use fake receipt created above if execution throws!!
} catch ( const TransactionException& ex ) {
// shoul not happen as exception in execute() means that tx should not be in block
// should not happen as exception in execute() means that tx should not be in block
BOOST_LOG( m_loggerError ) << DETAILED_ERROR;
assert( false );
} catch ( const std::exception& ex ) {
Expand Down Expand Up @@ -1414,7 +1391,7 @@ void Block::commitToSeal(
unsigned unclesCount = 0;

// here was code to handle 6 generations of uncles
// it was wtiting its results in two variables above
// it was waiting its results in two variables above
Comment thread
PropzSaladaz marked this conversation as resolved.

BytesMap transactionsMap;
BytesMap receiptsMap;
Expand Down Expand Up @@ -1517,8 +1494,6 @@ bool Block::sealBlock( bytesConstRef _header ) {
ret.appendRaw( m_currentUncles );
ret.swapOut( m_currentBytes );
m_currentBlock = BlockHeader( _header, HeaderData );
// cnote << "Mined " << m_currentBlock.hash() << "(parent: " << m_currentBlock.parentHash() <<
//")";
// TODO: move into SealEngine

m_state = m_precommit;
Expand Down
31 changes: 7 additions & 24 deletions libethereum/BlockChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ void BlockChain::open( fs::path const& _path, bool _applyPatches, WithExisting _
m_db_splitter = std::make_unique< batched_io::db_splitter >( m_db );
m_blocksDB = m_db_splitter->new_interface();
m_extrasDB = m_db_splitter->new_interface();
// m_blocksDB.reset( new db::DBImpl( chainPath / fs::path( "blocks" ) ) );
// m_extrasDB.reset( new db::DBImpl( extrasPath / fs::path( "extras" ) ) );
} catch ( db::DatabaseError const& ex ) {
// Check the exact reason of errror, in case of IOError we can display user-friendly message
if ( *boost::get_error_info< db::errinfo_dbStatusCode >( ex ) !=
Expand Down Expand Up @@ -332,8 +330,6 @@ void BlockChain::open( fs::path const& _path, bool _applyPatches, WithExisting _
BOOST_LOG( m_loggerDebug ) << "Opened blockchain DB. Latest: " << currentHash() << ' '
<< m_lastBlockNumber;

// dump_blocks_and_extras_db( *this, 0 );

if ( _applyPatches && TotalStorageUsedPatch::isInitOnChainNeeded( *m_db ) )
TotalStorageUsedPatch::initOnChain( *this );
}
Expand Down Expand Up @@ -423,8 +419,6 @@ tuple< ImportRoute, bool, unsigned > BlockChain::sync(
BlockQueue& _bq, State& _state, unsigned _max ) {
MICROPROFILE_SCOPEI( "BlockChain", "sync many blocks", MP_LIGHTGOLDENROD );

// _bq.tick(*this);

VerifiedBlocks blocks;
_bq.drain( blocks, _max );

Expand Down Expand Up @@ -453,10 +447,7 @@ tuple< ImportRoute, bool, unsigned > BlockChain::sync(
continue;
} catch ( dev::eth::UnknownParent const& ) {
BOOST_LOG( m_loggerWarning )
<< "ODD: Import queue contains block with unknown parent."; // <<
// LogTag::Error
// <<
// boost::current_exception_diagnostic_information();
<< "ODD: Import queue contains block with unknown parent.";
// NOTE: don't reimport since the queue should guarantee everything in the right
// order. Can't continue - chain bad.
badBlocks.push_back( block.verified.info.hash() );
Expand Down Expand Up @@ -811,11 +802,10 @@ void BlockChain::insertTransactionsDetailsToDb(
dev::Address to =
dev::Address( txFields.to.data(), dev::Address::ConstructFromPointer );
DecryptedTransactionData txData( txFields.data, to );
_extrasWriteBatch.insert(
toSlice( sha3( txBytes ), ExtraTransactionDecryptedData ),
_extrasWriteBatch.insert( toSlice( txHash, ExtraTransactionDecryptedData ),
( db::Slice ) dev::ref( txData.rlp() ) );
++regularTxnsIterator;
}
++regularTxnsIterator;
} else if ( _block.transactions.at( ta.index ).isCTX() &&
Bite2Patch::isEnabledInWorkingBlock() ) {
dev::h256 ctxOriginHash = _block.transactions[ta.index].getCTXOrigin();
Expand All @@ -840,7 +830,7 @@ void BlockChain::insertBloomsDetailsToDb(
//
// We need to compute log blooms directly here without using Block::logBloom()
// method because _receipts may contain extra receipt items corresponding to
// partially cought-up transactions
// partially caught-up transactions
//
// old code was: // LogBloom blockBloom = tbi.logBloom();
//
Expand Down Expand Up @@ -869,7 +859,6 @@ void BlockChain::insertBloomsDetailsToDb(
noteUsed( h, ExtraBlocksBlooms );

// Update database with them.
// ReadGuard l1( x_blocksBlooms );
WriteGuard l1( x_blocksBlooms );
{
MICROPROFILE_SCOPEI( "insertBlockAndExtras", "insert_to_extras", MP_LIGHTSKYBLUE );
Expand All @@ -882,7 +871,7 @@ void BlockChain::insertBloomsDetailsToDb(
}
}

// TOOD ACHTUNG This function must be kept in sync with the next one!
// TODO ACHTUNG This function must be kept in sync with the next one!
size_t BlockChain::prepareDbDataAndReturnSize( VerifiedBlockRef const& _block,
bytesConstRef _receipts, u256 const& _totalDifficulty, const LogBloom* pLogBloomFull,
ImportPerformanceLogger& _performanceLogger ) {
Expand All @@ -907,7 +896,7 @@ size_t BlockChain::prepareDbDataAndReturnSize( VerifiedBlockRef const& _block,
return writeSize;
}

// TOOD ACHTUNG This function must be kept in sync with prepareDbDataAndReturnSize defined above!!
// TODO ACHTUNG This function must be kept in sync with prepareDbDataAndReturnSize defined above!!
// TODO move it to TotalStorageUsedPatch!
void BlockChain::recomputeExistingOccupiedSpaceForBlockRotation() try {
unsigned number = this->number();
Expand Down Expand Up @@ -1201,8 +1190,6 @@ void BlockChain::rescue( State const& /*_state*/ ) {
details( h );
BOOST_LOG( m_loggerInfo ) << "state..." << flush;
BOOST_LOG( m_loggerInfo ) << "STATE VALIDITY CHECK IS NOT SUPPORTED" << flush;
// if (_db.exists(bi.stateRoot()))
// break;
} catch ( ... ) {
}
}
Expand Down Expand Up @@ -1400,10 +1387,9 @@ void BlockChain::garbageCollect( bool _force ) {
if ( m_lastStats.memTotal() < c_minCacheSize )
return;


m_lastCollection = chrono::system_clock::now();

// We subtract memory that blockhashes occupy because it is treated sepaparately
// We subtract memory that blockhashes occupy because it is treated separately
while ( m_lastStats.memTotal() - m_lastStats.memBlockHashes >= c_maxCacheSize ) {
Guard l( x_cacheUsage );
for ( CacheID const& id : m_cacheUsage.back() ) {
Expand Down Expand Up @@ -1606,9 +1592,6 @@ static inline unsigned upow( unsigned a, unsigned b ) {
static inline unsigned ceilDiv( unsigned n, unsigned d ) {
return ( n + d - 1 ) / d;
}
// static inline unsigned floorDivPow(unsigned n, unsigned a, unsigned b) { return n / upow(a,
// b); } static inline unsigned ceilDivPow(unsigned n, unsigned a, unsigned b) { return
// ceilDiv(n, upow(a, b)); }

// Level 1
// [xxx. ]
Expand Down
1 change: 0 additions & 1 deletion libethereum/BlockDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ BlockDetails::BlockDetails( RLP const& _r ) {

bytes BlockDetails::rlp() const {
auto ret = rlpList( number, totalDifficulty, parent, children, blockSizeBytes );
// size = ret.size();
return ret;
}

Expand Down
4 changes: 0 additions & 4 deletions libethereum/ChainParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,6 @@ const std::string& ChainParams::getOriginalJson() const {
params[c_tieBreakingGas] = tieBreakingGas;
params[c_blockReward] = toHex( toBigEndian( blockReward( DefaultSchedule ) ) );

// auto setOptionalU256Parameter = [&params](u256 &_destination, string const &_name) {
// if (params.count(_name))
// _destination = u256(fromBigEndian<u256>(fromHex(params.at(_name).get_str())));
// };
params[c_minGasLimit] = toHex( toBigEndian( minGasLimit ) );
params[c_maxGasLimit] = toHex( toBigEndian( maxGasLimit ) );
params[c_gasLimitBoundDivisor] = toHex( toBigEndian( gasLimitBoundDivisor ) );
Expand Down
Loading
Loading