Skip to content

Commit

Permalink
Quarterly release branch update and cherry-pick (#2983)
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte authored Nov 1, 2021
1 parent 1fa5786 commit 2f60f62
Show file tree
Hide file tree
Showing 17 changed files with 171 additions and 57 deletions.
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
# Changelog

## 21.10.0-RC4
## 21.10.0

### Additions and Improvements
- The EVM has been factored out into a standalone module, suitable for inclusion as a library. [#2790](https://github.com/hyperledger/besu/pull/2790)
- Low level performance improvements changes to cut worst-case EVM performance in half. [#2796](https://github.com/hyperledger/besu/pull/2796)
- Migrate `ExceptionalHaltReason` from an enum to an interface to allow downstream users of the EVM to add new exceptional halt reasons. [#2810](https://github.com/hyperledger/besu/pull/2810)
- reduces need for JUMPDEST analysis via caching [#2607](https://github.com/hyperledger/besu/pull/2821)
- Add support for custom private key file for public-key export and public-key export-address commands [#2801](https://github.com/hyperledger/besu/pull/2801)
- Add CLI autocomplete scripts. [#2854](https://github.com/hyperledger/besu/pull/2854)
- Added support for PKCS11 keystore on PKI Block Creation. [#2865](https://github.com/hyperledger/besu/pull/2865)
- add support for ArrowGlacier hardfork [#2943](https://github.com/hyperledger/besu/issues/2943)

### Bug Fixes
- Allow BESU_CONFIG_FILE environment to specify TOML file [#2455](https://github.com/hyperledger/besu/issues/2455)
- Fix bug with private contracts not able to call public contracts that call public contracts [#2816](https://github.com/hyperledger/besu/pull/2816)
- Fixes the exit condition for loading a BonsaiPersistedWorldState for a sibling block of the last one persisted [#2967](https://github.com/hyperledger/besu/pull/2967)
- Fixes bonsai getMutable regression affecting fast-sync [#2934](https://github.com/hyperledger/besu/pull/2934)
- Regression in RC1 involving LogOperation and frame memory overwrites [#2908](https://github.com/hyperledger/besu/pull/2908)
- Allow `eth_call` and `eth_estimateGas` to accept contract address as sender. [#2891](https://github.com/hyperledger/besu/pull/2891)
- Fixes the exit condition for loading a BonsaiPersistedWorldState for a sibling block of the last one persisted [#2967](https://github.com/hyperledger/besu/pull/2967)
- Fixes bonsai getMutable regression affecting fast-sync [#2934](https://github.com/hyperledger/besu/pull/2934)

### Early Access Features
- Enable plugins to expose custom JSON-RPC / WebSocket methods [#1317](https://github.com/hyperledger/besu/issues/1317)

### Download Link


## 21.10.0-RC4

### Additions and Improvements

### Bug Fixes
- Fixes the exit condition for loading a BonsaiPersistedWorldState for a sibling block of the last one persisted [#2967](https://github.com/hyperledger/besu/pull/2967)
- Fixes bonsai getMutable regression affecting fast-sync [#2934](https://github.com/hyperledger/besu/pull/2934)

### Early Access Features
### Download Link
https://hyperledger.jfrog.io/native/besu-binaries/besu/21.10.0-RC4/besu-21.10.0-RC4.zip \
SHA256: b16e15764b8bc06c5c3f9f19bc8b99fa48e7894aa5a6ccdad65da49bbf564793

## 21.10.0-RC3

Expand Down
7 changes: 4 additions & 3 deletions besu/src/test/java/org/hyperledger/besu/ForkIdsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ public static Collection<Object[]> parameters() {
new ForkId(Bytes.ofUnsignedInt(0x668db0afL), 9069000L),
new ForkId(Bytes.ofUnsignedInt(0x879d6e30L), 9200000L),
new ForkId(Bytes.ofUnsignedInt(0xe029e991L), 12244000L),
new ForkId(Bytes.ofUnsignedInt(0xeb440f6L), 12965000),
new ForkId(Bytes.ofUnsignedInt(0xb715077dL), 0L),
new ForkId(Bytes.ofUnsignedInt(0xb715077dL), 0L))
new ForkId(Bytes.ofUnsignedInt(0xeb440f6L), 12965000L),
new ForkId(Bytes.ofUnsignedInt(0xb715077dL), 13773000L),
new ForkId(Bytes.ofUnsignedInt(0x20c327fc), 0L),
new ForkId(Bytes.ofUnsignedInt(0x20c327fc), 0L))
},
new Object[] {
NetworkName.MORDOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public interface GenesisConfigOptions {

OptionalLong getLondonBlockNumber();

// TODO EIP-1559 change for the actual fork name when known
OptionalLong getAleutBlockNumber();
OptionalLong getArrowGlacierBlockNumber();

OptionalLong getEIP1559BlockNumber();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,31 +252,17 @@ public OptionalLong getBerlinBlockNumber() {

@Override
public OptionalLong getLondonBlockNumber() {
final OptionalLong londonBlock = getOptionalLong("londonblock");
final OptionalLong calaverasblock = getOptionalLong("calaverasblock");
if (calaverasblock.isPresent()) {
if (londonBlock.isPresent()) {
throw new RuntimeException(
"Genesis files cannot specify both londonblock and calaverasblock.");
}
return calaverasblock;
}
return londonBlock;
return getOptionalLong("londonblock");
}

@Override
public OptionalLong getAleutBlockNumber() {
return getOptionalLong("aleutblock");
public OptionalLong getArrowGlacierBlockNumber() {
return getOptionalLong("arrowglacierblock");
}

@Override
// TODO EIP-1559 change for the actual fork name when known
public OptionalLong getEIP1559BlockNumber() {
if (getAleutBlockNumber().isPresent()) {
return getAleutBlockNumber();
} else {
return getLondonBlockNumber();
}
return getLondonBlockNumber();
}

@Override
Expand Down Expand Up @@ -405,7 +391,7 @@ public Map<String, Object> asMap() {
getMuirGlacierBlockNumber().ifPresent(l -> builder.put("muirGlacierBlock", l));
getBerlinBlockNumber().ifPresent(l -> builder.put("berlinBlock", l));
getLondonBlockNumber().ifPresent(l -> builder.put("londonBlock", l));
getAleutBlockNumber().ifPresent(l -> builder.put("aleutBlock", l));
getArrowGlacierBlockNumber().ifPresent(l -> builder.put("arrowGlacierBlock", l));

// classic fork blocks
getClassicForkBlock().ifPresent(l -> builder.put("classicForkBlock", l));
Expand Down Expand Up @@ -507,7 +493,7 @@ public List<Long> getForks() {
getMuirGlacierBlockNumber(),
getBerlinBlockNumber(),
getLondonBlockNumber(),
getAleutBlockNumber(),
getArrowGlacierBlockNumber(),
getEcip1015BlockNumber(),
getDieHardBlockNumber(),
getGothamBlockNumber(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public class StubGenesisConfigOptions implements GenesisConfigOptions {
private OptionalLong muirGlacierBlockNumber = OptionalLong.empty();
private OptionalLong berlinBlockNumber = OptionalLong.empty();
private OptionalLong londonBlockNumber = OptionalLong.empty();
private OptionalLong arrowGlacierBlockNumber = OptionalLong.empty();

// TODO EIP-1559 change for the actual fork name when known
private final OptionalLong aleutBlockNumber = OptionalLong.empty();
private OptionalLong classicForkBlock = OptionalLong.empty();
private OptionalLong ecip1015BlockNumber = OptionalLong.empty();
private OptionalLong diehardBlockNumber = OptionalLong.empty();
Expand Down Expand Up @@ -180,18 +179,13 @@ public OptionalLong getLondonBlockNumber() {
}

@Override
// TODO EIP-1559 change for the actual fork name when known
public OptionalLong getAleutBlockNumber() {
return aleutBlockNumber;
public OptionalLong getArrowGlacierBlockNumber() {
return arrowGlacierBlockNumber;
}

@Override
public OptionalLong getEIP1559BlockNumber() {
if (getAleutBlockNumber().isPresent()) {
return getAleutBlockNumber();
} else {
return getLondonBlockNumber();
}
return getLondonBlockNumber();
}

@Override
Expand Down Expand Up @@ -294,7 +288,7 @@ public Map<String, Object> asMap() {
getMuirGlacierBlockNumber().ifPresent(l -> builder.put("muirGlacierBlock", l));
getBerlinBlockNumber().ifPresent(l -> builder.put("berlinBlock", l));
getLondonBlockNumber().ifPresent(l -> builder.put("londonBlock", l));
getAleutBlockNumber().ifPresent(l -> builder.put("aleutBlock", l));
getArrowGlacierBlockNumber().ifPresent(l -> builder.put("arrowGlacierBlock", l));
// classic fork blocks
getClassicForkBlock().ifPresent(l -> builder.put("classicForkBlock", l));
getEcip1015BlockNumber().ifPresent(l -> builder.put("ecip1015Block", l));
Expand Down Expand Up @@ -415,6 +409,11 @@ public StubGenesisConfigOptions londonBlock(final long blockNumber) {
return this;
}

public StubGenesisConfigOptions arrowGlacierBlock(final long blockNumber) {
arrowGlacierBlockNumber = OptionalLong.of(blockNumber);
return this;
}

public StubGenesisConfigOptions classicForkBlock(final long blockNumber) {
classicForkBlock = OptionalLong.of(blockNumber);
return this;
Expand Down
1 change: 1 addition & 0 deletions config/src/main/resources/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"muirGlacierBlock": 9200000,
"berlinBlock": 12244000,
"londonBlock": 12965000,
"arrowGlacierBlock": 13773000,
"ethash": {
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,9 @@ public void shouldGetLondonBlockNumber() {
}

@Test
public void shouldGetBaikalBlockNumber() {
final GenesisConfigOptions config = fromConfigOptions(singletonMap("calaverasblock", 1000));
assertThat(config.getEIP1559BlockNumber()).hasValue(1000);
assertThat(config.getLondonBlockNumber()).hasValue(1000);
public void shouldGetArrowGlacierBlockNumber() {
final GenesisConfigOptions config = fromConfigOptions(singletonMap("arrowGlacierBlock", 1000));
assertThat(config.getArrowGlacierBlockNumber()).hasValue(1000);
}

@Test
Expand All @@ -213,7 +212,7 @@ public void shouldNotReturnEmptyOptionalWhenBlockNumberNotSpecified() {
assertThat(config.getMuirGlacierBlockNumber()).isEmpty();
assertThat(config.getBerlinBlockNumber()).isEmpty();
assertThat(config.getLondonBlockNumber()).isEmpty();
assertThat(config.getAleutBlockNumber()).isEmpty();
assertThat(config.getArrowGlacierBlockNumber()).isEmpty();
assertThat(config.getEcip1049BlockNumber()).isEmpty();
}

Expand Down
2 changes: 1 addition & 1 deletion config/src/test/resources/all_forks.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"muirGlacierBlock": 9,
"berlinBlock": 10,
"londonBlock": 11,
"aleutBlock": 99,
"arrowGlacierBlock": 12,
"ecip1015Block": 102,
"dieHardBlock": 103,
"gothamBlock": 104,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public abstract class MainnetDifficultyCalculators {
private static final long CONSTANTINOPLE_FAKE_BLOCK_OFFSET = 4_999_999L;
private static final long MUIR_GLACIER_FAKE_BLOCK_OFFSET = 8_999_999L;
private static final long LONDON_FAKE_BLOCK_OFFSET = 9_699_999L;
private static final long ARROW_GLACIER_FAKE_BLOCK_OFFSET = 10_699_999L;

private MainnetDifficultyCalculators() {}

Expand Down Expand Up @@ -88,6 +89,11 @@ private MainnetDifficultyCalculators() {}
(time, parent, protocolContext) ->
calculateThawedDifficulty(time, parent, LONDON_FAKE_BLOCK_OFFSET);

// As per https://eips.ethereum.org/EIPS/eip-4345
static DifficultyCalculator ARROW_GLACIER =
(time, parent, protocolContext) ->
calculateThawedDifficulty(time, parent, ARROW_GLACIER_FAKE_BLOCK_OFFSET);

private static BigInteger calculateThawedDifficulty(
final long time, final BlockHeader parent, final long fakeBlockOffset) {
final BigInteger parentDifficulty = difficulty(parent.getDifficulty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ public ProtocolSpecBuilder londonDefinition(final GenesisConfigOptions genesisCo
evmConfiguration);
}

public ProtocolSpecBuilder arrowGlacierDefinition(
final GenesisConfigOptions genesisConfigOptions) {
return MainnetProtocolSpecs.arrowGlacierDefinition(
chainId,
contractSizeLimit,
evmStackSize,
isRevertReasonEnabled,
genesisConfigOptions,
quorumCompatibilityMode,
evmConfiguration);
}

////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// Classic Protocol Specs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,26 @@ static ProtocolSpecBuilder londonDefinition(
.name(LONDON_FORK_NAME);
}

static ProtocolSpecBuilder arrowGlacierDefinition(
final Optional<BigInteger> chainId,
final OptionalInt configContractSizeLimit,
final OptionalInt configStackSizeLimit,
final boolean enableRevertReason,
final GenesisConfigOptions genesisConfigOptions,
final boolean quorumCompatibilityMode,
final EvmConfiguration evmConfiguration) {
return londonDefinition(
chainId,
configContractSizeLimit,
configStackSizeLimit,
enableRevertReason,
genesisConfigOptions,
quorumCompatibilityMode,
evmConfiguration)
.difficultyCalculator(MainnetDifficultyCalculators.ARROW_GLACIER)
.name("ArrowGlacier");
}

private static TransactionReceipt frontierTransactionReceiptFactory(
// ignored because it's always FRONTIER
final TransactionType __,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ private TreeMap<Long, BuilderMapEntry> buildMilestoneMap(
create(config.getMuirGlacierBlockNumber(), specFactory.muirGlacierDefinition()),
create(config.getBerlinBlockNumber(), specFactory.berlinDefinition()),
create(config.getLondonBlockNumber(), specFactory.londonDefinition(config)),
create(
config.getArrowGlacierBlockNumber(),
specFactory.arrowGlacierDefinition(config)),
// Classic Milestones
create(config.getEcip1015BlockNumber(), specFactory.tangerineWhistleDefinition()),
create(config.getDieHardBlockNumber(), specFactory.dieHardDefinition()),
Expand Down Expand Up @@ -319,6 +322,8 @@ private void validateEthereumForkOrdering() {
validateForkOrder("MuirGlacier", config.getMuirGlacierBlockNumber(), lastForkBlock);
lastForkBlock = validateForkOrder("Berlin", config.getBerlinBlockNumber(), lastForkBlock);
lastForkBlock = validateForkOrder("London", config.getLondonBlockNumber(), lastForkBlock);
lastForkBlock =
validateForkOrder("ArrowGlacier", config.getArrowGlacierBlockNumber(), lastForkBlock);
assert (lastForkBlock >= 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public void shouldReturnDefaultProtocolSpecsWhenCustomNumbersAreNotUsed() {
Assertions.assertThat(sched.getByBlockNumber(9_200_000L).getName()).isEqualTo("MuirGlacier");
Assertions.assertThat(sched.getByBlockNumber(12_244_000L).getName()).isEqualTo("Berlin");
Assertions.assertThat(sched.getByBlockNumber(12_965_000L).getName()).isEqualTo("London");
Assertions.assertThat(sched.getByBlockNumber(Long.MAX_VALUE).getName()).isEqualTo("London");
Assertions.assertThat(sched.getByBlockNumber(13_773_000L).getName()).isEqualTo("ArrowGlacier");
Assertions.assertThat(sched.getByBlockNumber(Long.MAX_VALUE).getName())
.isEqualTo("ArrowGlacier");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static class Forks {
public static final List<Long> MAINNET =
Arrays.asList(
1920000L, 1150000L, 2463000L, 2675000L, 2675000L, 4370000L, 7280000L, 7280000L,
9069000L, 9200000L);
9069000L, 9200000L, 12244000L, 12965000L, 13773000L);
public static final List<Long> ROPSTEN =
Arrays.asList(0L, 0L, 10L, 1700000L, 4230000L, 4939394L, 6485846L, 7117117L);
public static final List<Long> RINKEBY =
Expand All @@ -76,15 +76,19 @@ public static class Forks {
public static class ForkIds {
public static final List<ForkId> MAINNET =
Arrays.asList(
new ForkId(Bytes.fromHexString("0xfc64ec04"), 1150000L), // Unsynced
new ForkId(
Bytes.fromHexString("0xfc64ec04"), 1150000L), // Unsynced / last Frontier block
new ForkId(Bytes.fromHexString("0x97c2c34c"), 1920000L), // First Homestead block
new ForkId(Bytes.fromHexString("0x91d1f948"), 2463000L), // First DAO block
new ForkId(Bytes.fromHexString("0x7a64da13"), 2675000L), // First Tangerine block
new ForkId(Bytes.fromHexString("0x3edd5b10"), 4370000L), // First Spurious block
new ForkId(Bytes.fromHexString("0xa00bc324"), 7280000L), // First Byzantium block
new ForkId(Bytes.fromHexString("0x668db0af"), 9069000L),
new ForkId(Bytes.fromHexString("0x879d6e30"), 9200000L),
new ForkId(Bytes.fromHexString("0xe029e991"), 0L));
new ForkId(Bytes.fromHexString("0x668db0af"), 9069000L), // First Petersburg block
new ForkId(Bytes.fromHexString("0x879d6e30"), 9200000L), // First Istanbul block
new ForkId(Bytes.fromHexString("0xe029e991"), 12244000L), // First Muir Glacier block
new ForkId(Bytes.fromHexString("0x0eb440f6"), 12965000L), // First Berlin block
new ForkId(Bytes.fromHexString("0xb715077d"), 13773000L), // First London block
new ForkId(Bytes.fromHexString("0x20c327fc"), 0L)); // First Arrow Glacier block
public static final List<ForkId> ROPSTEN =
Arrays.asList(
new ForkId(Bytes.fromHexString("0x30c7ddbc"), 10L),
Expand Down
Loading

0 comments on commit 2f60f62

Please sign in to comment.