Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Delay EIP96 from Byzantium to Constantinople
Browse files Browse the repository at this point in the history
  • Loading branch information
pirapira committed Aug 16, 2017
1 parent a8bac5d commit 84b2e64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libethcore/EVMSchedule.h
Expand Up @@ -106,7 +106,6 @@ static const EVMSchedule EIP158Schedule = []
static const EVMSchedule ByzantiumSchedule = []
{
EVMSchedule schedule = EIP158Schedule;
schedule.blockhashGas = 800;
schedule.haveRevert = true;
schedule.haveReturnData = true;
schedule.haveStaticCall = true;
Expand All @@ -116,6 +115,7 @@ static const EVMSchedule ByzantiumSchedule = []
static const EVMSchedule ConstantinopleSchedule = []
{
EVMSchedule schedule = ByzantiumSchedule;
schedule.blockhashGas = 800;
schedule.haveCreate2 = true;
return schedule;
}();
Expand Down
6 changes: 3 additions & 3 deletions libethereum/Block.cpp
Expand Up @@ -702,15 +702,15 @@ void Block::updateBlockhashContract()
{
u256 const blockNumber = info().number();

u256 const byzantiumForkBlock = m_sealEngine->chainParams().u256Param("byzantiumForkBlock");
if (blockNumber == byzantiumForkBlock)
u256 const constantinopleForkBlock = m_sealEngine->chainParams().u256Param("constantinopleForkBlock");
if (blockNumber == constantinopleForkBlock)
{
m_state.createContract(c_blockhashContractAddress);
m_state.setCode(c_blockhashContractAddress, bytes(c_blockhashContractCode));
m_state.commit(State::CommitBehaviour::KeepEmptyAccounts);
}

if (blockNumber >= byzantiumForkBlock)
if (blockNumber >= constantinopleForkBlock)
{
DummyLastBlockHashes lastBlockHashes; // assuming blockhash contract won't need BLOCKHASH itself
Executive e(*this, lastBlockHashes);
Expand Down
2 changes: 1 addition & 1 deletion libethereum/ExtVM.cpp
Expand Up @@ -149,7 +149,7 @@ h256 ExtVM::blockHash(u256 _number)
if (_number >= currentNumber || _number < (std::max<u256>(256, currentNumber) - 256))
return h256();

if (currentNumber < m_sealEngine.chainParams().u256Param("byzantiumForkBlock") + 256)
if (currentNumber < m_sealEngine.chainParams().u256Param("constantinopleForkBlock") + 256)
{
h256 const parentHash = envInfo().header().parentHash();
h256s const lastHashes = envInfo().lastHashes().precedingHashes(parentHash);
Expand Down

0 comments on commit 84b2e64

Please sign in to comment.