Skip to content

Commit

Permalink
Merge pull request #2 from ChainSafe/ed/rebase
Browse files Browse the repository at this point in the history
Rebase updating from upstream hyperledger
  • Loading branch information
edwardmack authored Oct 4, 2019
2 parents d84f14e + 5e0d9dd commit bad1049
Show file tree
Hide file tree
Showing 134 changed files with 3,010 additions and 935 deletions.
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,50 @@
# Changelog


### Java 11 Required from v1.2

From v1.2, Besu requires Java 11. Besu on Java 8 is no longer supported.

### Docker Image Migration

In v1.2, we removed the entry-point script from our Docker image. Refer to the [migration guide](https://besu.hyperledger.org/en/latest/Deploying-Besu/High-Availability/)
In v1.2, we removed the entry-point script from our Docker image. Refer to the [migration guide](https://besu.hyperledger.org/en/latest/HowTo/Get-Started/Migration-Docker/)
for information on options that were previously automatically added to the Besu command line.

### 1.3

### Breaking Change

- Disallow comments in Genesis JSON file. [\#49](https://github.com/hyperledger/besu/pull/49)

### Additions and Improvements

- Store db metadata file in the root data directory. [\#46](https://github.com/hyperledger/besu/pull/46)
- Add `--target-gas-limit` command line option. [\#24](https://github.com/hyperledger/besu/pull/24)(thanks to new contributor [cfelde](https://github.com/cfelde))
- Allow private contracts to access public state. [\#9](https://github.com/hyperledger/besu/pull/9)
- Documentation updates include:
- Added [sample load balancer configurations](https://besu.hyperledger.org/en/latest/HowTo/Configure/Configure-HA/Sample-Configuration/)
- Added [`retesteth`](https://besu.hyperledger.org/en/latest/Reference/CLI/CLI-Subcommands/#retesteth) subcommand
- Added [`debug_accountRange`](https://besu.hyperledger.org/en/latest/Reference/API-Methods/#debug_accountrange) JSON-RPC API method
- Clarified purpose of [static nodes](https://besu.hyperledger.org/en/latest/HowTo/Find-and-Connect/Managing-Peers/#static-nodes)
- Added links [Kubernetes reference implementations](https://besu.hyperledger.org/en/latest/HowTo/Deploy/Kubernetes/)
- Added content about [access between private and public states](https://besu.hyperledger.org/en/latest/Concepts/Privacy/Privacy-Groups/#access-between-states)
- Added restriction that [account permissioning cannot be used with random key signing](https://besu.hyperledger.org/en/latest/HowTo/Use-Privacy/Sign-Privacy-Marker-Transactions/).
- Added high availability requirement for [private transaction manager](https://besu.hyperledger.org/en/latest/Concepts/Privacy/Privacy-Overview/#availability) (ie, Orion)
- Added [genesis file reference](https://besu.hyperledger.org/en/latest/Reference/Config-Items/)

### Technical Improvements

- Less verbose synching subscriptions [\#59](https://github.com/hyperledger/besu/pull/59)
- Return enclave key instead of private transaction hash [\#53](https://github.com/hyperledger/besu/pull/53)
- Fix mark sweep pruner bugs where nodes that should be kept were being swept [\#50](https://github.com/hyperledger/besu/pull/50)
- Clean up BesuConfiguration construction [\#51](https://github.com/hyperledger/besu/pull/51)
- Private tx nonce errors return same msg as any tx [\#48](https://github.com/hyperledger/besu/pull/48)
- Fix default logging [\#47](https://github.com/hyperledger/besu/pull/47)
- Introduce virtual operation. [\#45](https://github.com/hyperledger/besu/pull/45)
- Downgrade RocksDBPlugin Logging Levels [\#44](https://github.com/hyperledger/besu/pull/44)
- Infrastructure for exposing PoA metrics for plugins. [\#37](https://github.com/hyperledger/besu/pull/37)
- Refactor privacy storage. [\#7](https://github.com/hyperledger/besu/pull/7)

## 1.2.4

### Additions and Improvements
Expand Down
72 changes: 18 additions & 54 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ def shouldPublish() {
return env.BRANCH_NAME == 'master' || env.BRANCH_NAME ==~ /^release-\d+\.\d+/
}

def isSnapshotVersion(v) {
return (v ==~ /.*-SNAPSHOT/)
}

if (shouldPublish()) {
properties([
buildDiscarder(
Expand Down Expand Up @@ -236,8 +240,7 @@ exit $status
if (env.BRANCH_NAME == 'master') {
additionalTags.add('develop')
}

if (! version ==~ /.*-SNAPSHOT/) {
if (! isSnapshotVersion(version)) {
additionalTags.add('latest')
additionalTags.add(version.split(/\./)[0..1].join('.'))
}
Expand Down Expand Up @@ -265,64 +268,25 @@ exit $status
version = gradleProperties.version
}

// we dont publish snapshots to bintray
if (! (version ==~ /.*-SNAPSHOT/)) {

stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
}
stage(stage_name + 'Publish') {
withCredentials([
usernamePassword(
credentialsId: 'pegasys-bintray',
usernameVariable: 'BINTRAY_USER',
passwordVariable: 'BINTRAY_KEY'
)
]) {
sh './gradlew --no-daemon --parallel bintrayUpload'
}
stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
}
stage(stage_name + 'Publish') {
withCredentials([
usernamePassword(
credentialsId: 'pegasys-bintray',
usernameVariable: 'BINTRAY_USER',
passwordVariable: 'BINTRAY_KEY'
)
]) {
sh './gradlew --no-daemon --parallel bintrayUpload'
}

}

}
}
}
}
}, AzurePublish: {
def stage_name = "Publish jars: "
def version = ''
node {
if (shouldPublish()) {
checkout scm

docker.image(docker_image_dind).withRun('--privileged') { d ->
docker.image(build_image).inside("--link ${d.id}:docker") {

stage(stage_name + 'Calculate variables') {
def gradleProperties = readProperties file: 'gradle.properties'
version = gradleProperties.version
}

if (version ==~ /.*-SNAPSHOT/) { // Only publish snapshots to Azure
stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
}
stage(stage_name + 'Publish') {
withCredentials([
usernamePassword(
credentialsId: 'hyperledger-azure',
usernameVariable: 'AZURE_USER',
passwordVariable: 'AZURE_KEY'
)
]) {
sh './gradlew --no-daemon --parallel publish'
}
}
}
}
}
}
}
}
}
} catch (e) {
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Besu Ethereum Client
[![Build Status](https://jenkins.pegasys.tech/job/Besu/job/master/badge/icon)](https://jenkins.pegasys.tech/job/Besu/job/master/)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/hyperledger/besu.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/hyperledger/besu/alerts/)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/hyperledger/besu.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/hyperledger/besu/context:java)
[![Documentation Status](https://readthedocs.org/projects/hyperledger-besu/badge/?version=latest)](https://besu.hyperledger.org/en/latest/?badge=latest)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3174/badge)](https://bestpractices.coreinfrastructure.org/projects/3174)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/PegasysEng/besu/blob/master/LICENSE)
[ ![Download](https://api.bintray.com/packages/hyperledger-org/besu-repo/besu/images/download.svg) ](https://bintray.com/hyperledger-org/besu-repo/besu/_latestVersion)
[![RocketChat chat](https://open.rocket.chat/images/join-chat.svg)](https://chat.hyperledger.org/channel/besu)
Expand Down
23 changes: 23 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Hyperledger Security Policy

## Reporting a Security Bug

If you think you have discovered a security issue in any of the Hyperledger
projects, we'd love to hear from you. We will take all security bugs
seriously and if confirmed upon investigation we will patch it within a
reasonable amount of time and release a public security bulletin discussing
the impact and credit the discoverer.

There are two ways to report a security bug. The easiest is to email a
description of the flaw and any related information (e.g. reproduction
steps, version) to
[security at hyperledger dot org](mailto:[email protected]).

The other way is to file a confidential security bug in our
[JIRA bug tracking system](https://jira.hyperledger.org).
Be sure to set the “Security Level” to “Security issue”.

The process by which the Hyperledger Security Team handles security bugs
is documented further in our
[Defect Response](https://wiki.hyperledger.org/display/HYP/Defect+Response)
page on our [wiki](https://wiki.hyperledger.org).
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.hyperledger.besu.cli.config.EthNetworkConfig;
import org.hyperledger.besu.controller.BesuController;
import org.hyperledger.besu.controller.BesuControllerBuilder;
import org.hyperledger.besu.controller.GasLimitCalculator;
import org.hyperledger.besu.controller.KeyPairUtil;
import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
Expand Down Expand Up @@ -148,6 +149,7 @@ public void startNode(final BesuNode node) {
.clock(Clock.systemUTC())
.isRevertReasonEnabled(node.isRevertReasonEnabled())
.storageProvider(storageProvider)
.targetGasLimit(GasLimitCalculator.DEFAULT)
.build();
} catch (final IOException e) {
throw new RuntimeException("Error building BesuController", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.hyperledger.besu.tests.acceptance.dsl.privacy.condition.PrivateTransactionVerifier;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.contract.PrivateContractTransactions;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.PrivacyTransactions;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.contract.ContractTransactions;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.eth.EthTransactions;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.net.NetTransactions;

import org.junit.After;
Expand All @@ -37,10 +39,12 @@ public class PrivacyAcceptanceTestBase {
protected final PrivateContractTransactions privateContractTransactions;
protected final PrivacyCluster privacyCluster;
protected final PrivacyAccountResolver privacyAccountResolver;

protected final ContractTransactions contractTransactions;
protected final NetConditions net;
protected final EthTransactions ethTransactions;

public PrivacyAcceptanceTestBase() {
ethTransactions = new EthTransactions();
net = new NetConditions(new NetTransactions());
privacyTransactions = new PrivacyTransactions();
privateContractVerifier = new PrivateContractVerifier();
Expand All @@ -49,6 +53,7 @@ public PrivacyAcceptanceTestBase() {
privateContractTransactions = new PrivateContractTransactions();
privacyCluster = new PrivacyCluster(net);
privacyAccountResolver = new PrivacyAccountResolver();
contractTransactions = new ContractTransactions();
}

@After
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction;

import org.hyperledger.besu.tests.acceptance.dsl.transaction.NodeRequests;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction;

import java.io.IOException;

public class PrivDistributeTransactionTransaction implements Transaction<String> {
private String signedPrivateTransaction;

public PrivDistributeTransactionTransaction(final String signedPrivateTransaction) {
this.signedPrivateTransaction = signedPrivateTransaction;
}

@Override
public String execute(final NodeRequests node) {
try {
return node.privacy()
.privDistributeTransaction(signedPrivateTransaction)
.send()
.getTransactionKey();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ public CreatePrivacyGroupTransaction createPrivacyGroup(
public FindPrivacyGroupTransaction findPrivacyGroup(final List<String> nodes) {
return new FindPrivacyGroupTransaction(nodes);
}

public PrivDistributeTransactionTransaction privDistributeTransaction(
final String signedPrivateTransaction) {
return new PrivDistributeTransactionTransaction(signedPrivateTransaction);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,41 @@
*/
package org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy;

import static java.util.Collections.singletonList;

import org.web3j.protocol.Web3jService;
import org.web3j.protocol.core.Request;
import org.web3j.protocol.core.Response;
import org.web3j.protocol.pantheon.Pantheon;

public class PrivacyRequestFactory {
private final Pantheon besuClient;
private final Web3jService web3jService;

public PrivacyRequestFactory(final Web3jService web3jService) {
this.web3jService = web3jService;
this.besuClient = Pantheon.build(web3jService);
}

public Pantheon getBesuClient() {
return besuClient;
}

public Request<?, PrivDistributeTransactionResponse> privDistributeTransaction(
final String signedPrivateTransaction) {
return new Request<>(
"priv_distributeRawTransaction",
singletonList(signedPrivateTransaction),
web3jService,
PrivDistributeTransactionResponse.class);
}

public static class PrivDistributeTransactionResponse extends Response<String> {

public PrivDistributeTransactionResponse() {}

public String getTransactionKey() {
return getResult();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright 2019 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* 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;

import "./EventEmitter.sol";

// compile with:
// solc CrossContractReader.sol --bin --abi --optimize --overwrite -o .
// then create web3j wrappers with:
// web3j solidity generate -b ./generated/CrossContractReader.bin -a ./generated/CrossContractReader.abi -o ../../../../../ -p org.hyperledger.besu.tests.web3j.generated
contract CrossContractReader {
uint counter;

event NewEventEmitter(
address contractAddress
);

function read(address emitter_address) view public returns (uint) {
EventEmitter em = EventEmitter(emitter_address);
return em.value();
}

function deploy() public {
EventEmitter em = new EventEmitter();
emit NewEventEmitter(address(em));
}

function deployRemote(address crossAddress) public {
CrossContractReader cross = CrossContractReader(crossAddress);
cross.deploy();
}

function increment() public {
counter++;
}

function incrementRemote(address crossAddress) public {
CrossContractReader cross = CrossContractReader(crossAddress);
cross.increment();
}

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

function remoteDestroy(address crossAddress) public {
CrossContractReader cross = CrossContractReader(crossAddress);
cross.destroy();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"constant":false,"inputs":[{"name":"crossAddress","type":"address"}],"name":"remoteDestroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"crossAddress","type":"address"}],"name":"deployRemote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deploy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"emitter_address","type":"address"}],"name":"read","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"increment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"crossAddress","type":"address"}],"name":"incrementRemote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"contractAddress","type":"address"}],"name":"NewEventEmitter","type":"event"}]
Loading

0 comments on commit bad1049

Please sign in to comment.