This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #916 from ethereum/eip-100
EIP-100 add uncles adjustment to the difficulty
- Loading branch information
Showing
8 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
ethereumj-core/src/main/java/org/ethereum/config/blockchain/ByzantiumConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.ethereum.config.blockchain; | ||
|
||
import org.ethereum.config.BlockchainConfig; | ||
import org.ethereum.config.Constants; | ||
import org.ethereum.core.Block; | ||
import org.ethereum.core.BlockHeader; | ||
import org.ethereum.core.Repository; | ||
import org.spongycastle.util.encoders.Hex; | ||
|
||
import java.math.BigInteger; | ||
|
||
/** | ||
* EIPs included in the Hard Fork: | ||
* <ul> | ||
* <li>100 - Change difficulty adjustment to target mean block time including uncles</li> | ||
* <li>140 - REVERT instruction in the Ethereum Virtual Machine</li> | ||
* <li>196 - Precompiled contracts for addition and scalar multiplication on the elliptic curve alt_bn128</li> | ||
* <li>197 - Precompiled contracts for optimal Ate pairing check on the elliptic curve alt_bn128</li> | ||
* <li>198 - Precompiled contract for bigint modular exponentiation</li> | ||
* <li>211 - New opcodes: RETURNDATASIZE and RETURNDATACOPY</li> | ||
* <li>214 - New opcode STATICCALL</li> | ||
* <li>658 - Embedding transaction return data in receipts</li> | ||
* </ul> | ||
* | ||
* @author Mikhail Kalinin | ||
* @since 14.08.2017 | ||
*/ | ||
public class ByzantiumConfig extends Eip160HFConfig { | ||
|
||
public ByzantiumConfig(BlockchainConfig parent) { | ||
super(parent); | ||
} | ||
|
||
@Override | ||
public BigInteger getCalcDifficultyMultiplier(BlockHeader curBlock, BlockHeader parent) { | ||
long unclesAdj = parent.hasUncles() ? 2 : 1; | ||
return BigInteger.valueOf(Math.max(unclesAdj - (curBlock.getTimestamp() - parent.getTimestamp()) / 9, -99)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters