Skip to content

Commit

Permalink
Merge branch 'hyperledger:main' into eth_call_to_optional
Browse files Browse the repository at this point in the history
  • Loading branch information
fab-10 authored Dec 16, 2021
2 parents 43dd7fa + a1eb15f commit d0fd34e
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ commands:
- run:
name: Install Packages - LibSodium, nssdb
command: |
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install -y libsodium23 libsodium-dev apt-transport-https haveged libnss3-tools
sudo apt-get install -y libsodium23 libsodium-dev apt-transport-https haveged libnss3-tools solc
sudo service haveged restart
- restore_cache:
name: Restore cached gradle dependencies
Expand Down
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Changelog

## 21.10.4
## 22.1.0-RC2

### 21.10.4 Breaking Changes
### Additions and Improvements

### Bug Fixes

## 22.1.0-RC1

### 22.1.0-RC1 Breaking Changes
- Plugin API: BlockHeader.getBaseFee() method now returns an optional Wei instead of an optional Long [#3065](https://github.com/hyperledger/besu/issues/3065)

### Additions and Improvements
- Represent baseFee as Wei instead of long accordingly to the spec [#2785](https://github.com/hyperledger/besu/issues/2785)
- Adding support of the NO_COLOR environment variable as described in the [NO_COLOR](https://no-color.org/) standard [#3085](https://github.com/hyperledger/besu/pull/3085)
- Add `privx_findFlexiblePrivacyGroup` RPC Method, `privx_findOnchainPrivacyGroup` will be removed in a future release [#3075](https://github.com/hyperledger/besu/pull/3075)
- The invalid value is now shown when `--bootnodes` cannot parse an item to make it easier to identify which option is invalid.
- The invalid value is now shown when `--bootnodes` cannot parse an item to make it easier to identify which option is invalid.
- Adding two new options to be able to specify desired TLS protocol version and Java cipher suites [#3105](https://github.com/hyperledger/besu/pull/3105)
- Implements [EIP-4399](https://eips.ethereum.org/EIPS/eip-4399) to repurpose DIFFICULTY opcode after the merge as a source of entropy from the Beacon chain. [#3081](https://github.com/hyperledger/besu/issues/3081)

Expand All @@ -20,6 +26,10 @@
### Early Access Features
- Add support for additional JWT authentication algorithms [#3017](https://github.com/hyperledger/besu/pull/3017)

### Download Links
https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/22.1.0-RC1/besu-22.1.0-RC1.zip \ SHA256: 8f471a30a7d22a6830c5f7ed87d1f2110bdaeb6751007ffa0fb44783a7c80850
https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/22.1.0-RC1/besu-22.1.0-RC1.tar.gz \ SHA256 302ead51c85bf282047104974968ce88ce626df609082700e6e187b26180e0fd

## 21.10.3

### Bug Fixes
Expand Down
4 changes: 3 additions & 1 deletion acceptance-tests/tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

plugins {
id 'org.web3j' version '4.8.4'
id 'org.web3j' version '4.8.8'
id 'org.web3j.solidity' version '0.3.2'
}

Expand All @@ -24,6 +24,8 @@ sourceSets.main.solidity.srcDirs = ["$projectDir/contracts"]

solidity {
resolvePackages = false
executable = "/usr/bin/solc"
version = "0.8.10"
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions acceptance-tests/tests/contracts/CrossContractReader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
pragma solidity >=0.4.0 <0.6.0;
pragma solidity >=0.4.0 <0.9.0;

import "./EventEmitter.sol";

Expand Down Expand Up @@ -50,7 +50,7 @@ contract CrossContractReader {
}

function destroy() public {
selfdestruct(msg.sender);
selfdestruct(payable(msg.sender));
}

function remoteDestroy(address crossAddress) public {
Expand Down
4 changes: 2 additions & 2 deletions acceptance-tests/tests/contracts/EventEmitter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

pragma solidity >=0.4.0 <0.6.0;
pragma solidity >=0.4.0 <0.9.0;

// compile with:
// solc EventEmitter.sol --bin --abi --optimize --overwrite -o .
Expand All @@ -25,7 +25,7 @@ contract EventEmitter {
address _sender;
uint _value;

constructor() public {
constructor() {
owner = msg.sender;
}

Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/tests/contracts/RemoteSimpleStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
pragma solidity >=0.4.0 <0.6.0;
pragma solidity >=0.4.0 <0.9.0;

import "./SimpleStorage.sol";

Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/tests/contracts/RevertReason.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
pragma solidity >=0.4.0 <0.6.0;
pragma solidity >=0.4.0 <0.9.0;

// compile with:
// solc RevertReason.sol --bin --abi --optimize --overwrite -o .
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/tests/contracts/SimpleStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

pragma solidity >=0.4.0 <0.6.0;
pragma solidity >=0.4.0 <0.9.0;

// compile with:
// solc SimpleStorage.sol --bin --abi --optimize --overwrite -o .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.Optional;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.web3j.protocol.core.methods.response.TransactionReceipt;

Expand Down Expand Up @@ -68,6 +69,7 @@ public void setup() throws IOException {
}

@Test
@Ignore // since changing the solidity code in #3183 the contractAddress is incorrect
public void canDeployContractSignedByPlugin() throws Exception {
final String contractAddress = "0xd0152772c54cecfa7684f09f7616dcc825545dff";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader;
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.manager.EthMessage;
import org.hyperledger.besu.ethereum.eth.manager.EthPeer;
import org.hyperledger.besu.ethereum.eth.manager.task.GetBlockFromPeersTask;
import org.hyperledger.besu.ethereum.eth.manager.task.RetryingGetBlockFromPeersTask;
import org.hyperledger.besu.ethereum.eth.messages.EthPV62;
import org.hyperledger.besu.ethereum.eth.messages.NewBlockHashesMessage;
Expand Down Expand Up @@ -149,6 +151,27 @@ private void onBlockAdded(final BlockAddedEvent blockAddedEvent) {
LOG.info("Imported {} pending blocks", r.size());
}
});
} else {

LOG.trace("Not ready for import blocks found for {}", newBlock.getHeader().getNumber());

pendingBlocksManager
.lowestAnnouncedBlock()
.map(ProcessableBlockHeader::getNumber)
.ifPresent(
minAnnouncedBlockNumber -> {
long distance =
minAnnouncedBlockNumber
- protocolContext.getBlockchain().getChainHeadBlockNumber();
LOG.trace(
"Found lowest announced block {} with distance {}",
minAnnouncedBlockNumber,
distance);
if (distance < config.getBlockPropagationRange().upperEndpoint()
&& minAnnouncedBlockNumber > newBlock.getHeader().getNumber()) {
retrieveMissingAnnouncedBlock(newBlock.getHeader().getNumber() + 1);
}
});
}

if (blockAddedEvent.getEventType().equals(EventType.HEAD_ADVANCED)) {
Expand Down Expand Up @@ -251,6 +274,18 @@ private void handleNewBlockHashesFromNetwork(final EthMessage message) {
}
}

private CompletableFuture<Block> retrieveMissingAnnouncedBlock(final long blockNumber) {
LOG.trace("Retrieve missing announced block {} from peer", blockNumber);
final List<EthPeer> peers =
ethContext.getEthPeers().streamBestPeers().collect(Collectors.toList());
final GetBlockFromPeersTask getBlockTask =
GetBlockFromPeersTask.create(
peers, protocolSchedule, ethContext, Optional.empty(), blockNumber, metricsSystem);
return getBlockTask
.run()
.thenCompose((r) -> importOrSavePendingBlock(r.getResult(), r.getPeer().nodeId()));
}

private CompletableFuture<Block> processAnnouncedBlock(final NewBlockHash newBlock) {
final RetryingGetBlockFromPeersTask getBlockTask =
RetryingGetBlockFromPeersTask.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import java.util.function.Supplier;

import org.apache.tuweni.bytes.Bytes;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
Expand All @@ -82,6 +83,7 @@ public abstract class AbstractBlockPropagationManagerTest {
protected final MetricsSystem metricsSystem = new NoOpMetricsSystem();

@Test
@Ignore // temporarily ignore waiting on Karim's fix
public void importsAnnouncedBlocks_aheadOfChainInOrder() {
blockchainUtil.importFirstBlocks(2);
final Block nextBlock = blockchainUtil.getBlock(2);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=21.10.4-SNAPSHOT
version=22.1.0-RC2-SNAPSHOT

# Workaround for Java 16 and spotless bug 834 https://github.com/diffplug/spotless/issues/834
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
Expand Down

0 comments on commit d0fd34e

Please sign in to comment.