diff --git a/CHANGELOG.md b/CHANGELOG.md index c6ea29c999e..399e7dfc6ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog ## 22.10.0-RC2 +### Breaking Changes +- Flexible Privacy Groups (early access) support to Tessera's EC encryptor (contracts modified) [#4282](https://github.com/hyperledger/besu/pull/4282) + * Before this change, the `bytes32` type was used for the enclave public keys, just supporting encryptors with public keys of that length (like the default NaCl) + * For the EC encryptor, the encoded public key length is 91 + ### Additions and Improvements ### Bug Fixes @@ -42,7 +47,6 @@ https://hyperledger.jfrog.io/hyperledger/besu-binaries/besu/22.7.5/besu-22.7.5.t ## 22.7.4 - ### Bug Fixes - Remove records that track transactions by sender when they are empty to same memory in the transaction pool [#4415](https://github.com/hyperledger/besu/pull/4415) - Add Toml configuration file support for _--Xplugin-rocksdb-high-spec-enabled_ flag [#4438](https://github.com/hyperledger/besu/pull/4438) @@ -51,7 +55,6 @@ https://hyperledger.jfrog.io/hyperledger/besu-binaries/besu/22.7.5/besu-22.7.5.t - https://hyperledger.jfrog.io/hyperledger/besu-binaries/besu/22.7.4/besu-22.7.4.zip / sha256: 4f2a0c20bee7f266ec1dcb45fa90ae1ca42f4b22e9b21a601b7705357259aea9 - https://hyperledger.jfrog.io/hyperledger/besu-binaries/besu/22.7.4/besu-22.7.4.tar.gz / sha256: a60efc4d515ac94710bbc6d61a24f409b03fcfc02323bee2a2d75c883fc99dce - ## 22.7.3 ### Additions and Improvements diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/privacy/PrivacyNodeFactory.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/privacy/PrivacyNodeFactory.java index 0d96b6c3f2b..03188db8a27 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/privacy/PrivacyNodeFactory.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/privacy/PrivacyNodeFactory.java @@ -19,6 +19,7 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationFactory; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; import org.hyperledger.besu.tests.acceptance.dsl.privacy.account.PrivacyAccount; +import org.hyperledger.enclave.testutil.EnclaveEncryptorType; import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration; import org.hyperledger.enclave.testutil.EnclaveType; @@ -233,8 +234,11 @@ public PrivacyNode createFlexiblePrivacyGroupEnabledMinerNode( final BesuNodeConfigurationBuilder besuNodeConfigurationBuilder = new BesuNodeConfigurationBuilder(); if (multiTenancyEnabled) { - besuNodeConfigurationBuilder.jsonRpcAuthenticationConfiguration( - "authentication/auth_priv.toml"); + final String authPrivTomlPath = + EnclaveEncryptorType.EC.equals(privacyAccount.getEnclaveEncryptorType()) + ? "authentication/auth_priv_ec_pubkey.toml" + : "authentication/auth_priv.toml"; + besuNodeConfigurationBuilder.jsonRpcAuthenticationConfiguration(authPrivTomlPath); } return create( new PrivacyNodeConfiguration( @@ -252,7 +256,9 @@ public PrivacyNode createFlexiblePrivacyGroupEnabledMinerNode( .keyFilePath(privacyAccount.getPrivateKeyPath()) .build(), new EnclaveKeyConfiguration( - privacyAccount.getEnclaveKeyPaths(), privacyAccount.getEnclavePrivateKeyPaths())), + privacyAccount.getEnclaveKeyPaths(), + privacyAccount.getEnclavePrivateKeyPaths(), + privacyAccount.getEnclaveEncryptorType())), enclaveType, containerNetwork); } @@ -279,7 +285,9 @@ public PrivacyNode createFlexiblePrivacyGroupEnabledNode( .webSocketEnabled() .build(), new EnclaveKeyConfiguration( - privacyAccount.getEnclaveKeyPaths(), privacyAccount.getEnclavePrivateKeyPaths())), + privacyAccount.getEnclaveKeyPaths(), + privacyAccount.getEnclavePrivateKeyPaths(), + privacyAccount.getEnclaveEncryptorType())), enclaveType, containerNetwork); } diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/privacy/PrivacyRequestFactory.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/privacy/PrivacyRequestFactory.java index 5aa58ff7c4e..056598a9d56 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/privacy/PrivacyRequestFactory.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/privacy/PrivacyRequestFactory.java @@ -14,7 +14,6 @@ */ package org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy; -import static com.google.common.base.Preconditions.checkArgument; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.FLEXIBLE_PRIVACY_PROXY; @@ -41,6 +40,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.tuweni.bytes.Bytes; +import org.web3j.abi.FunctionEncoder; +import org.web3j.abi.TypeReference; +import org.web3j.abi.Utils; +import org.web3j.abi.datatypes.Bool; +import org.web3j.abi.datatypes.DynamicArray; +import org.web3j.abi.datatypes.DynamicBytes; +import org.web3j.abi.datatypes.Function; +import org.web3j.abi.datatypes.Type; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3jService; import org.web3j.protocol.besu.Besu; @@ -102,8 +109,6 @@ public static class GetPrivacyPrecompileAddressResponse extends Response
{} - public static class JsonRpcSuccessResponseResponse extends Response {} - public static class CreatePrivacyGroupResponse extends Response {} public static class DeletePrivacyGroupResponse extends Response {} @@ -232,7 +237,13 @@ public String privxRemoveFromPrivacyGroup( } private Bytes encodeRemoveFromGroupFunctionCall(final Bytes toRemove) { - return Bytes.concatenate(FlexibleGroupManagement.REMOVE_PARTICIPANT_METHOD_SIGNATURE, toRemove); + final Function function = + new Function( + "removeParticipant", + Arrays.asList(new DynamicBytes(toRemove.toArrayUnsafe())), + Arrays.asList(new TypeReference() {})); + + return Bytes.fromHexString(FunctionEncoder.encode(function)); } public String privxLockPrivacyGroup( @@ -588,29 +599,19 @@ public String getTransactionHash() { } private Bytes encodeAddToGroupFunctionCall(final List participants) { - return Bytes.concatenate( - FlexibleGroupManagement.ADD_PARTICIPANTS_METHOD_SIGNATURE, encodeList(participants)); - } - - private Bytes encodeList(final List participants) { - final Bytes dynamicParameterOffset = encodeLong(32); - final Bytes length = encodeLong(participants.size()); - return Bytes.concatenate( - dynamicParameterOffset, - length, - Bytes.fromHexString( - participants.stream() - .map(Bytes::toUnprefixedHexString) - .collect(Collectors.joining("")))); - } - - // long to uint256, 8 bytes big endian, so left padded by 24 bytes - private static Bytes encodeLong(final long l) { - checkArgument(l >= 0, "Unsigned value must be positive"); - final byte[] longBytes = new byte[8]; - for (int i = 0; i < 8; i++) { - longBytes[i] = (byte) ((l >> ((7 - i) * 8)) & 0xFF); - } - return Bytes.concatenate(Bytes.wrap(new byte[24]), Bytes.wrap(longBytes)); + final Function function = + new Function( + "addParticipants", + Arrays.asList( + new DynamicArray<>( + DynamicBytes.class, + Utils.typeMap( + participants.stream() + .map(Bytes::toArrayUnsafe) + .collect(Collectors.toList()), + DynamicBytes.class))), + Collections.emptyList()); + + return Bytes.fromHexString(FunctionEncoder.encode(function)); } } diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTest.java index d64f73d2a03..3f32904ba76 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTest.java @@ -17,6 +17,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.FLEXIBLE_PRIVACY_PROXY; +import static org.hyperledger.enclave.testutil.EnclaveEncryptorType.EC; +import static org.hyperledger.enclave.testutil.EnclaveEncryptorType.NACL; +import static org.hyperledger.enclave.testutil.EnclaveType.TESSERA; import static org.junit.runners.Parameterized.Parameters; import org.hyperledger.besu.tests.acceptance.dsl.condition.eth.EthConditions; @@ -53,14 +56,21 @@ public class FlexiblePrivacyAcceptanceTest extends FlexiblePrivacyAcceptanceTestBase { private final EnclaveType enclaveType; + private final EnclaveEncryptorType enclaveEncryptorType; - public FlexiblePrivacyAcceptanceTest(final EnclaveType enclaveType) { + public FlexiblePrivacyAcceptanceTest( + final EnclaveType enclaveType, final EnclaveEncryptorType enclaveEncryptorType) { this.enclaveType = enclaveType; + this.enclaveEncryptorType = enclaveEncryptorType; } - @Parameters(name = "{0}") - public static Collection enclaveTypes() { - return EnclaveType.valuesForTests(); + @Parameters(name = "{0} enclave type with {1} encryptor") + public static Collection enclaveParameters() { + return Arrays.asList( + new Object[][] { + {TESSERA, NACL}, + {TESSERA, EC} + }); } private PrivacyNode alice; @@ -82,21 +92,21 @@ public void setUp() throws Exception { alice = privacyBesu.createFlexiblePrivacyGroupEnabledMinerNode( "node1", - PrivacyAccountResolver.ALICE.resolve(EnclaveEncryptorType.NACL), + PrivacyAccountResolver.ALICE.resolve(enclaveEncryptorType), false, enclaveType, Optional.of(containerNetwork)); bob = privacyBesu.createFlexiblePrivacyGroupEnabledNode( "node2", - PrivacyAccountResolver.BOB.resolve(EnclaveEncryptorType.NACL), + PrivacyAccountResolver.BOB.resolve(enclaveEncryptorType), false, enclaveType, Optional.of(containerNetwork)); charlie = privacyBesu.createFlexiblePrivacyGroupEnabledNode( "node3", - PrivacyAccountResolver.CHARLIE.resolve(EnclaveEncryptorType.NACL), + PrivacyAccountResolver.CHARLIE.resolve(enclaveEncryptorType), false, enclaveType, Optional.of(containerNetwork)); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTestBase.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTestBase.java index 7dc2460f82e..9e4f1638dad 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTestBase.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/FlexiblePrivacyAcceptanceTestBase.java @@ -18,7 +18,6 @@ import static org.hyperledger.besu.ethereum.core.PrivacyParameters.FLEXIBLE_PRIVACY_PROXY; import static org.hyperledger.besu.ethereum.privacy.group.FlexibleGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyAcceptanceTestBase; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; import org.hyperledger.besu.tests.acceptance.dsl.privacy.condition.ExpectValidFlexiblePrivacyGroupCreated; @@ -32,6 +31,10 @@ import java.util.stream.Collectors; import org.apache.tuweni.bytes.Bytes; +import org.web3j.abi.FunctionEncoder; +import org.web3j.abi.Utils; +import org.web3j.abi.datatypes.DynamicArray; +import org.web3j.abi.datatypes.DynamicBytes; import org.web3j.protocol.besu.response.privacy.PrivateTransactionReceipt; import org.web3j.protocol.core.methods.response.TransactionReceipt; import org.web3j.tx.Contract; @@ -79,8 +82,7 @@ protected String createFlexiblePrivacyGroup( final String commitmentHash = callGetParticipantsMethodAndReturnCommitmentHash(privacyGroupId, groupCreator, privateFrom); final PrivateTransactionReceipt expectedReceipt = - buildExpectedAddMemberTransactionReceipt( - privacyGroupId, groupCreator, addresses.toArray(new String[] {})); + buildExpectedAddMemberTransactionReceipt(privacyGroupId, groupCreator, addresses); for (final PrivacyNode member : members) { member.verify( @@ -103,7 +105,7 @@ protected String callGetParticipantsMethodAndReturnCommitmentHash( } protected PrivateTransactionReceipt buildExpectedAddMemberTransactionReceipt( - final String privacyGroupId, final PrivacyNode groupCreator, final String[] members) { + final String privacyGroupId, final PrivacyNode groupCreator, final List members) { return buildExpectedAddMemberTransactionReceipt( privacyGroupId, groupCreator, groupCreator.getEnclaveKey(), members); } @@ -112,18 +114,26 @@ protected PrivateTransactionReceipt buildExpectedAddMemberTransactionReceipt( final String privacyGroupId, final PrivacyNode groupCreator, final String privateFrom, - final String[] members) { + final List members) { + final StringBuilder output = new StringBuilder(); // hex prefix output.append("0x"); - // Dynamic array offset - output.append("0000000000000000000000000000000000000000000000000000000000000020"); - // Length of the array (with padded zeros to the left) - output.append(Quantity.longToPaddedHex(members.length, 32).substring(2)); - // Each member enclave key converted from Base64 to bytes - for (final String member : members) { - output.append(Bytes.fromBase64String(member).toUnprefixedHexString()); - } + + final String encodedParameters = + FunctionEncoder.encode( + "", + Arrays.asList( + new DynamicArray<>( + DynamicBytes.class, + Utils.typeMap( + members.stream() + .map(Bytes::fromBase64String) + .map(Bytes::toArrayUnsafe) + .collect(Collectors.toList()), + DynamicBytes.class)))); + + output.append(encodedParameters); return new PrivateTransactionReceipt( null, diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyGroupTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyGroupTest.java index 3cf9a943a43..2e5d6ec6ded 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyGroupTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyGroupTest.java @@ -45,9 +45,9 @@ public class PrivacyGroupTest extends AcceptanceTestBase { private static final String RAW_FIRST_PARTICIPANT = "0x5aa68ac0"; private static final String RAW_ADD_PARTICIPANT = - "0xb4926e25000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000012a8d9b56a0fe9cd94d60be4413bcb721d3a7be27ed8e28b3a6346df874ee141b"; + "0x965a25ef00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000202a8d9b56a0fe9cd94d60be4413bcb721d3a7be27ed8e28b3a6346df874ee141b"; private static final String RAW_REMOVE_PARTICIPANT = - "0xfd0177972a8d9b56a0fe9cd94d60be4413bcb721d3a7be27ed8e28b3a6346df874ee141b"; + "0x1f52a8ee000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000202a8d9b56a0fe9cd94d60be4413bcb721d3a7be27ed8e28b3a6346df874ee141b"; private static final String RAW_LOCK = "0xf83d08ba"; private static final String RAW_UNLOCK = "0xa69df4b5"; private static final String RAW_CAN_EXECUTE = "0x78b90337"; @@ -73,28 +73,28 @@ public void rlp() throws Exception { .validTransactionReceipt(contractAddress) .verify(defaultPrivacyGroupManagementContract); // 0x0b0235be - assertThat(RAW_FIRST_PARTICIPANT) - .isEqualTo(defaultPrivacyGroupManagementContract.getParticipants().encodeFunctionCall()); + assertThat(defaultPrivacyGroupManagementContract.getParticipants().encodeFunctionCall()) + .isEqualTo(RAW_FIRST_PARTICIPANT); // 0xf744b089 - assertThat(RAW_ADD_PARTICIPANT) - .isEqualTo( + assertThat( defaultPrivacyGroupManagementContract .addParticipants(Collections.singletonList(secondParticipant.raw())) - .encodeFunctionCall()); + .encodeFunctionCall()) + .isEqualTo(RAW_ADD_PARTICIPANT); // 0xf744b089 - assertThat(RAW_REMOVE_PARTICIPANT) - .isEqualTo( + assertThat( defaultPrivacyGroupManagementContract .removeParticipant(secondParticipant.raw()) - .encodeFunctionCall()); - assertThat(RAW_LOCK) - .isEqualTo(defaultPrivacyGroupManagementContract.lock().encodeFunctionCall()); - assertThat(RAW_UNLOCK) - .isEqualTo(defaultPrivacyGroupManagementContract.unlock().encodeFunctionCall()); - assertThat(RAW_CAN_EXECUTE) - .isEqualTo(defaultPrivacyGroupManagementContract.canExecute().encodeFunctionCall()); - assertThat(RAW_GET_VERSION) - .isEqualTo(defaultPrivacyGroupManagementContract.getVersion().encodeFunctionCall()); + .encodeFunctionCall()) + .isEqualTo(RAW_REMOVE_PARTICIPANT); + assertThat(defaultPrivacyGroupManagementContract.lock().encodeFunctionCall()) + .isEqualTo(RAW_LOCK); + assertThat(defaultPrivacyGroupManagementContract.unlock().encodeFunctionCall()) + .isEqualTo(RAW_UNLOCK); + assertThat(defaultPrivacyGroupManagementContract.canExecute().encodeFunctionCall()) + .isEqualTo(RAW_CAN_EXECUTE); + assertThat(defaultPrivacyGroupManagementContract.getVersion().encodeFunctionCall()) + .isEqualTo(RAW_GET_VERSION); } @Test diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyProxyTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyProxyTest.java index 57b24610744..1c6763f4c92 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyProxyTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/contracts/PrivacyProxyTest.java @@ -49,7 +49,7 @@ public class PrivacyProxyTest extends AcceptanceTestBase { private static final String RAW_GET_PARTICIPANTS = "0x5aa68ac0"; private static final String RAW_ADD_PARTICIPANT = - "0xb4926e2500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001f772b2ee55f016431cefe724a05814324bb96e9afdb73e338665a693d4653678"; + "0x965a25ef0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020f772b2ee55f016431cefe724a05814324bb96e9afdb73e338665a693d4653678"; private BesuNode minerNode; private DefaultFlexiblePrivacyGroupManagementContract @@ -76,14 +76,14 @@ public void rlp() throws Exception { contractVerifier .validTransactionReceipt(flexiblePrivacyGroupManagementProxy.getContractAddress()) .verify(flexiblePrivacyGroupManagementProxy); - assertThat(RAW_GET_PARTICIPANTS) - .isEqualTo(flexiblePrivacyGroupManagementProxy.getParticipants().encodeFunctionCall()); + assertThat(flexiblePrivacyGroupManagementProxy.getParticipants().encodeFunctionCall()) + .isEqualTo(RAW_GET_PARTICIPANTS); - assertThat(RAW_ADD_PARTICIPANT) - .isEqualTo( + assertThat( flexiblePrivacyGroupManagementProxy .addParticipants(List.of(firstParticipant.raw())) - .encodeFunctionCall()); + .encodeFunctionCall()) + .isEqualTo(RAW_ADD_PARTICIPANT); } @Test diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/FlexibleMultiTenancyAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/FlexibleMultiTenancyAcceptanceTest.java index 7907c37a110..da692f21ba1 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/FlexibleMultiTenancyAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/FlexibleMultiTenancyAcceptanceTest.java @@ -16,6 +16,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.hyperledger.enclave.testutil.EnclaveEncryptorType.EC; +import static org.hyperledger.enclave.testutil.EnclaveEncryptorType.NACL; +import static org.hyperledger.enclave.testutil.EnclaveType.TESSERA; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode; @@ -32,6 +35,7 @@ import org.hyperledger.enclave.testutil.EnclaveType; import java.math.BigInteger; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -53,14 +57,21 @@ public class FlexibleMultiTenancyAcceptanceTest extends FlexiblePrivacyAcceptanceTestBase { private final EnclaveType enclaveType; + private final EnclaveEncryptorType enclaveEncryptorType; - public FlexibleMultiTenancyAcceptanceTest(final EnclaveType enclaveType) { + public FlexibleMultiTenancyAcceptanceTest( + final EnclaveType enclaveType, final EnclaveEncryptorType enclaveEncryptorType) { this.enclaveType = enclaveType; + this.enclaveEncryptorType = enclaveEncryptorType; } - @Parameterized.Parameters(name = "{0}") - public static Collection enclaveTypes() { - return EnclaveType.valuesForTests(); + @Parameterized.Parameters(name = "{0} enclave type with {1} encryptor") + public static Collection enclaveParameters() { + return Arrays.asList( + new Object[][] { + {TESSERA, NACL}, + {TESSERA, EC} + }); } private static final PermissioningTransactions permissioningTransactions = @@ -75,7 +86,7 @@ public void setUp() throws Exception { alice = privacyBesu.createFlexiblePrivacyGroupEnabledMinerNode( "node1", - PrivacyAccountResolver.MULTI_TENANCY.resolve(EnclaveEncryptorType.NACL), + PrivacyAccountResolver.MULTI_TENANCY.resolve(enclaveEncryptorType), true, enclaveType, Optional.empty()); @@ -448,7 +459,7 @@ private String createFlexiblePrivacyGroup(final MultiTenancyPrivacyGroup group) privacyGroupId, groupCreatorNode, groupCreatorTenant); final PrivateTransactionReceipt expectedReceipt = buildExpectedAddMemberTransactionReceipt( - privacyGroupId, groupCreatorNode, groupCreatorTenant, members.toArray(new String[] {})); + privacyGroupId, groupCreatorNode, groupCreatorTenant, members); for (final MultiTenancyPrivacyNode mtpn : multiTenancyPrivacyNodes) { final PrivacyNode privacyNode = mtpn.getPrivacyNode(); diff --git a/acceptance-tests/tests/src/test/resources/authentication/auth_priv_ec_pubkey.toml b/acceptance-tests/tests/src/test/resources/authentication/auth_priv_ec_pubkey.toml new file mode 100644 index 00000000000..291973d7ce7 --- /dev/null +++ b/acceptance-tests/tests/src/test/resources/authentication/auth_priv_ec_pubkey.toml @@ -0,0 +1,19 @@ +[Users.user] +password = "$2a$10$l3GA7K8g6rJ/Yv.YFSygCuI9byngpEzxgWS9qEg5emYDZomQW7fGC" +permissions = ["fakePermission", "*:*"] +privacyPublicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES8nC4qT/KdoAoTSF3qs/47DUsDihyVbWiRjZAiyvqp9eSDkqV1RzlM+58oOwnpFRwvWNZM+AxMVxT+MvxdsqMA==" + +[Users.user2] +password = "$2a$10$0ikMUcSYugKmnXilimhc1eGNnfMRvKt2PxQJPo1oCemN16QL2NNo." +permissions = ["fakePermission", "*:*"] +privacyPublicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXIgZqRA25V+3nN+Do6b5r0jiUunub6ubjPhqwHpPxP44uUYh9RKCQNRnsqCJ9PjeTnC8R3ieJk7HWAlycU1bug==" + +[Users.user3] +password = "$2a$10$Mydyzpul6CtgPRbUd6It2OpZDOfqOocpi6.UYhlyU5aphQHi1iQZq" +permissions = ["fakePermission", "*:*"] +privacyPublicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFl85WnNPyzSEX+evc774xoqUQdjSnQMTE1uIyMOve+iVwjs6dUEUwz5teiKuUUf63a/qYe4n6SGnQ7HnmtDViQ==" + +[Users.failUser] +password = "$2a$10$l3GA7K8g6rJ/Yv.YFSygCuI9byngpEzxgWS9qEg5emYDZomQW7fGC" +permissions = ["fakePermission", "*:*"] +privacyPublicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE30vyCv2v4EHwqnr0LEGaCX6GWfmYIIxLRw1PISeFsOk1tmY2hAYjEHkaZzu31SlFx0ickh10MEublBnrxCiJIA==" diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java index df731e88399..595727752b5 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java @@ -16,7 +16,6 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.FLEXIBLE_PRIVACY_PROXY; -import static org.hyperledger.besu.ethereum.privacy.FlexiblePrivacyGroupContract.decodeList; import static org.hyperledger.besu.ethereum.privacy.group.FlexibleGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.FlexibleGroupManagement.GET_VERSION_METHOD_SIGNATURE; @@ -130,7 +129,11 @@ public Optional findPrivacyGroupByGroupId( if (rlpInput.nextSize() > 0) { return Optional.of( new PrivacyGroup( - privacyGroupId, PrivacyGroup.Type.FLEXIBLE, "", "", decodeList(rlpInput.raw()))); + privacyGroupId, + PrivacyGroup.Type.FLEXIBLE, + "", + "", + FlexibleUtil.decodeList(rlpInput.raw()))); } } return Optional.empty(); @@ -283,6 +286,7 @@ private Optional buildAndSendAddPayload( enclave.send(bytes.toBase64String(), privacyUserId, privateFor).getKey()); } } + return Optional.empty(); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyGroupContract.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyGroupContract.java index 90b4d6c2403..6a1ce56f70a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyGroupContract.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyGroupContract.java @@ -39,15 +39,12 @@ import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.plugin.data.Restriction; -import java.util.ArrayList; -import java.util.List; import java.util.Optional; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; -import org.apache.tuweni.units.bigints.UInt256; /* This class is an abstraction on top of the privacy group management smart contract. @@ -67,6 +64,7 @@ that is not on a block boundary. Used this way, the object's lifetime is intended to be short. */ public class FlexiblePrivacyGroupContract { + @FunctionalInterface public interface TransactionSimulator { Optional simulate( @@ -167,7 +165,11 @@ private Optional readPrivacyGroupFromResult( if (rlpInput.nextSize() > 0) { final PrivacyGroup privacyGroup = new PrivacyGroup( - privacyGroupId, PrivacyGroup.Type.FLEXIBLE, "", "", decodeList(rlpInput.raw())); + privacyGroupId, + PrivacyGroup.Type.FLEXIBLE, + "", + "", + FlexibleUtil.decodeList(rlpInput.raw())); return Optional.of(privacyGroup); } else { return Optional.empty(); @@ -227,20 +229,4 @@ private CallParameter buildCallParams(final Bytes methodCall) { return new CallParameter( Address.ZERO, FLEXIBLE_PRIVACY_PROXY, 3000000, Wei.of(1000), Wei.ZERO, methodCall); } - - public static List decodeList(final Bytes rlpEncodedList) { - final ArrayList decodedElements = new ArrayList<>(); - // first 32 bytes is dynamic list offset - if (rlpEncodedList.size() < 64) return decodedElements; - // Bytes uses a byte[] for the content which can only have up to Integer.MAX_VALUE-5 elements - final int lengthOfList = - UInt256.fromBytes(rlpEncodedList.slice(32, 32)).toInt(); // length of list - if (rlpEncodedList.size() < 64 + lengthOfList * 32) return decodedElements; - - for (int i = 0; i < lengthOfList; ++i) { - decodedElements.add( - Bytes.wrap(rlpEncodedList.slice(64 + (32 * i), 32)).toBase64String()); // participant - } - return decodedElements; - } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java index ab3382b4815..1425fdb114e 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java @@ -24,6 +24,7 @@ import java.util.Optional; import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.units.bigints.UInt256; public class FlexibleUtil { @@ -40,11 +41,54 @@ public static boolean isGroupAdditionTransaction(final PrivateTransaction privat } public static List getParticipantsFromParameter(final Bytes input) { + if (input.size() < 68) return new ArrayList<>(); + final int numberOfParticipants = UInt256.fromBytes(input.slice(4 + 32, 32)).toInt(); + + // Method selector + offset + number of participants + (offset * number of participants) + final Bytes encodedParticipants = input.slice(4 + 32 + 32 + (32 * numberOfParticipants)); + + return getParticipantsFromEncodedParticipants(encodedParticipants, numberOfParticipants); + } + + public static List decodeList(final Bytes rlpEncodedList) { + if (rlpEncodedList.size() < 64) return new ArrayList<>(); + + // Bytes uses a byte[] for the content which can only have up to Integer.MAX_VALUE-5 elements + final int lengthOfList = + UInt256.fromBytes(rlpEncodedList.slice(32, 32)).toInt(); // length of list + + final Bytes encodedParticipants = rlpEncodedList.slice(32 + 32 + (32 * lengthOfList)); + + return getParticipantsFromEncodedParticipants(encodedParticipants, lengthOfList); + } + + private static List getParticipantsFromEncodedParticipants( + final Bytes encodedParticipants, final int numberOfParticipants) { final List participants = new ArrayList<>(); - final Bytes mungedParticipants = input.slice(4 + 32 + 32); - for (int i = 0; i <= mungedParticipants.size() - 32; i += 32) { - participants.add(mungedParticipants.slice(i, 32).toBase64String()); + + if (numberOfParticipants == 0) return participants; + // The participant value is enclosed in the closest multiple of 32 (for instance, 91 would be + // enclosed in 96) + final int sliceSize = encodedParticipants.size() / numberOfParticipants; + + // All the participants have to have the same size, so it is enough to check the first one + final int participantSize = UInt256.fromBytes(encodedParticipants.slice(0, 32)).toInt(); + + // Each slice should have a size of 32 bytes (because of the size value of each participant) + + // the actual participant wrapped in a 32 byte long multiple (96 for 91) + final int mod32ParticipantsSize = participantSize % 32; + final int participantSizeBytes32Wrapped = + mod32ParticipantsSize != 0 + ? (32 - mod32ParticipantsSize) + participantSize + : participantSize; + if (sliceSize != 32 + participantSizeBytes32Wrapped) return participants; + + for (int i = 0; i <= encodedParticipants.size() - sliceSize; i += sliceSize) { + // The size of each participant (as of now, either 32 or 91 because of the enclave public key + // size for NaCl and EC) is stored in 32 bytes + participants.add(encodedParticipants.slice(i + 32, participantSize).toBase64String()); } + return participants; } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/group/FlexibleGroupManagement.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/group/FlexibleGroupManagement.java index 30d6a704a12..06477cc839a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/group/FlexibleGroupManagement.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/group/FlexibleGroupManagement.java @@ -19,17 +19,17 @@ public class FlexibleGroupManagement { public static final Bytes PROXY_RUNTIME_BYTECODE = Bytes.fromHexString( - "608060405234801561001057600080fd5b506004361061009e5760003560e01c80639738968c116100665780639738968c146101b8578063a69df4b5146101d8578063b4926e25146101e2578063f83d08ba146102b0578063fd017797146102ba5761009e565b80630d8e6e2c146100a35780633659cfe6146100c15780635aa68ac0146101055780635c60da1b1461016457806378b9033714610198575b600080fd5b6100ab6102fe565b6040518082815260200191505060405180910390f35b610103600480360360208110156100d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103ab565b005b61010d61083e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610150578082015181840152602081019050610135565b505050509050019250505060405180910390f35b61016c610987565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101a06109ab565b60405180821515815260200191505060405180910390f35b6101c0610a58565b60405180821515815260200191505060405180910390f35b6101e0610b07565b005b610298600480360360208110156101f857600080fd5b810190808035906020019064010000000081111561021557600080fd5b82018360208201111561022757600080fd5b8035906020019184602083028401116401000000008311171561024957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610b90565b60405180821515815260200191505060405180910390f35b6102b8610c8d565b005b6102e6600480360360208110156102d057600080fd5b8101908080359060200190929190505050610d16565b60405180821515815260200191505060405180910390f35b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16630d8e6e2c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561036a57600080fd5b505afa15801561037e573d6000803e3d6000fd5b505050506040513d602081101561039457600080fd5b810190808051906020019092919050505091505090565b3073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f157600080fd5b505afa158015610405573d6000803e3d6000fd5b505050506040513d602081101561041b57600080fd5b810190808051906020019092919050505061049e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f54686520636f6e7472616374206973206c6f636b65642e00000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610543576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526054815260200180610e5a6054913960600191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561058b57600080fd5b505af115801561059f573d6000803e3d6000fd5b505050506040513d60208110156105b557600080fd5b810190808051906020019092919050505061061b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610eae602f913960400191505060405180910390fd5b60603073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b815260040160006040518083038186803b15801561066357600080fd5b505afa158015610677573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156106a157600080fd5b81019080805160405193929190846401000000008211156106c157600080fd5b838201915060208201858111156106d757600080fd5b82518660208202830111640100000000821117156106f457600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561072b578082015181840152602081019050610710565b50505050905001604052505050905061074382610e16565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663b4926e25836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b838110156107d85780820151818401526020810190506107bd565b5050505090500192505050602060405180830381600087803b1580156107fd57600080fd5b505af1158015610811573d6000803e3d6000fd5b505050506040513d602081101561082757600080fd5b810190808051906020019092919050505050505050565b606060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b815260040160006040518083038186803b1580156108ac57600080fd5b505afa1580156108c0573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156108ea57600080fd5b810190808051604051939291908464010000000082111561090a57600080fd5b8382019150602082018581111561092057600080fd5b825186602082028301116401000000008211171561093d57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015610974578082015181840152602081019050610959565b5050505090500160405250505091505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b815260040160206040518083038186803b158015610a1757600080fd5b505afa158015610a2b573d6000803e3d6000fd5b505050506040513d6020811015610a4157600080fd5b810190808051906020019092919050505091505090565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610ac657600080fd5b505af1158015610ada573d6000803e3d6000fd5b505050506040513d6020811015610af057600080fd5b810190808051906020019092919050505091505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a69df4b56040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b5050505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663b4926e25846040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b83811015610c25578082015181840152602081019050610c0a565b5050505090500192505050602060405180830381600087803b158015610c4a57600080fd5b505af1158015610c5e573d6000803e3d6000fd5b505050506040513d6020811015610c7457600080fd5b8101908080519060200190929190505050915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663f83d08ba6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610cfb57600080fd5b505af1158015610d0f573d6000803e3d6000fd5b5050505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1663fd017797856040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015610d9157600080fd5b505af1158015610da5573d6000803e3d6000fd5b505050506040513d6020811015610dbb57600080fd5b810190808051906020019092919050505090508015610e0c577fef2df0cc0f44b5a36a7de9951ef49ba4d861649244ff89bcf7ffaa1ac7291e89846040518082815260200191505060405180910390a15b8092505050919050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe54686520636f6e747261637420746f207570677261646520746f2068617320746f20626520646966666572656e742066726f6d207468652063757272656e74206d616e6167656d656e7420636f6e74726163742e4e6f7420616c6c6f77656420746f207570677261646520746865206d616e6167656d656e7420636f6e74726163742ea26469706673582212203cacc7680fcd907639c87ed995ee91e1de9ef4d7da7437f854fb3a8fbab9b0db64736f6c634300060c0033"); + "608060405234801561001057600080fd5b506004361061009e5760003560e01c806378b903371161006657806378b9033714610149578063965a25ef146101675780639738968c14610197578063a69df4b5146101b5578063f83d08ba146101bf5761009e565b80630d8e6e2c146100a35780631f52a8ee146100c15780633659cfe6146100f15780635aa68ac01461010d5780635c60da1b1461012b575b600080fd5b6100ab6101c9565b6040516100b8919061113e565b60405180910390f35b6100db60048036038101906100d69190610e37565b610273565b6040516100e89190611123565b60405180910390f35b61010b60048036038101906101069190610d1a565b610375565b005b6101156106c7565b6040516101229190611101565b60405180910390f35b610133610778565b60405161014091906110c2565b60405180910390f35b61015161079c565b60405161015e9190611123565b60405180910390f35b610181600480360381019061017c9190610d47565b610846565b60405161018e9190611123565b60405180910390f35b61019f610902565b6040516101ac9190611123565b60405180910390f35b6101bd6109ae565b005b6101c7610a37565b005b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16630d8e6e2c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561023557600080fd5b505afa158015610249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026d9190610e0a565b91505090565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16631f52a8ee86866040518363ffffffff1660e01b81526004016102d6929190611159565b602060405180830381600087803b1580156102f057600080fd5b505af1158015610304573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103289190610ddd565b9050801561036a577f52213552a930e6de0c0d7df74ece31dac1306b2c7e200ceded7a4442853189b58585604051610361929190611159565b60405180910390a15b809250505092915050565b3073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b815260040160206040518083038186803b1580156103bb57600080fd5b505afa1580156103cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f39190610ddd565b610432576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104299061117d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156104c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b89061119d565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561050957600080fd5b505af115801561051d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105419190610ddd565b610580576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610577906111bd565b60405180910390fd5b60003073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b815260040160006040518083038186803b1580156105c857600080fd5b505afa1580156105dc573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906106059190610d94565b905061061082610ac0565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663965a25ef836040518263ffffffff1660e01b815260040161066f9190611101565b602060405180830381600087803b15801561068957600080fd5b505af115801561069d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c19190610ddd565b50505050565b606060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b815260040160006040518083038186803b15801561073557600080fd5b505afa158015610749573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107729190610d94565b91505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b815260040160206040518083038186803b15801561080857600080fd5b505afa15801561081c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108409190610ddd565b91505090565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663965a25ef85856040518363ffffffff1660e01b81526004016108a79291906110dd565b602060405180830381600087803b1580156108c157600080fd5b505af11580156108d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f99190610ddd565b91505092915050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561097057600080fd5b505af1158015610984573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a89190610ddd565b91505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a69df4b56040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610a1c57600080fd5b505af1158015610a30573d6000803e3d6000fd5b5050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663f83d08ba6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610aa557600080fd5b505af1158015610ab9573d6000803e3d6000fd5b5050505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610b16610b1184611202565b6111dd565b90508083825260208201905082856020860282011115610b3957610b3861144e565b5b60005b85811015610b8757815167ffffffffffffffff811115610b5f57610b5e611444565b5b808601610b6c8982610cec565b85526020850194506020840193505050600181019050610b3c565b5050509392505050565b6000610ba4610b9f8461122e565b6111dd565b905082815260208101848484011115610bc057610bbf611453565b5b610bcb8482856113a7565b509392505050565b600081359050610be281611565565b92915050565b60008083601f840112610bfe57610bfd611444565b5b8235905067ffffffffffffffff811115610c1b57610c1a61143f565b5b602083019150836020820283011115610c3757610c3661144e565b5b9250929050565b600082601f830112610c5357610c52611444565b5b8151610c63848260208601610b03565b91505092915050565b600081519050610c7b8161157c565b92915050565b600081519050610c9081611593565b92915050565b60008083601f840112610cac57610cab611444565b5b8235905067ffffffffffffffff811115610cc957610cc861143f565b5b602083019150836001820283011115610ce557610ce461144e565b5b9250929050565b600082601f830112610d0157610d00611444565b5b8151610d11848260208601610b91565b91505092915050565b600060208284031215610d3057610d2f611462565b5b6000610d3e84828501610bd3565b91505092915050565b60008060208385031215610d5e57610d5d611462565b5b600083013567ffffffffffffffff811115610d7c57610d7b611458565b5b610d8885828601610be8565b92509250509250929050565b600060208284031215610daa57610da9611462565b5b600082015167ffffffffffffffff811115610dc857610dc7611458565b5b610dd484828501610c3e565b91505092915050565b600060208284031215610df357610df2611462565b5b6000610e0184828501610c6c565b91505092915050565b600060208284031215610e2057610e1f611462565b5b6000610e2e84828501610c81565b91505092915050565b60008060208385031215610e4e57610e4d611462565b5b600083013567ffffffffffffffff811115610e6c57610e6b611458565b5b610e7885828601610c96565b92509250509250929050565b6000610e91848484610fc6565b90509392505050565b6000610ea68383611020565b905092915050565b610eb781611350565b82525050565b6000610ec983856112a9565b935083602084028501610edb8461125f565b8060005b87811015610f21578484038952610ef682846112ed565b610f01868284610e84565b9550610f0c8461128f565b935060208b019a505050600181019050610edf565b50829750879450505050509392505050565b6000610f3e82611279565b610f4881856112a9565b935083602082028501610f5a85611269565b8060005b85811015610f965784840389528151610f778582610e9a565b9450610f828361129c565b925060208a01995050600181019050610f5e565b50829750879550505050505092915050565b610fb181611362565b82525050565b610fc08161136e565b82525050565b6000610fd283856112ba565b9350610fdf838584611398565b610fe883611467565b840190509392505050565b6000610fff83856112cb565b935061100c838584611398565b61101583611467565b840190509392505050565b600061102b82611284565b61103581856112ba565b93506110458185602086016113a7565b61104e81611467565b840191505092915050565b60006110666017836112dc565b915061107182611478565b602082019050919050565b60006110896054836112dc565b9150611094826114a1565b606082019050919050565b60006110ac602f836112dc565b91506110b782611516565b604082019050919050565b60006020820190506110d76000830184610eae565b92915050565b600060208201905081810360008301526110f8818486610ebd565b90509392505050565b6000602082019050818103600083015261111b8184610f33565b905092915050565b60006020820190506111386000830184610fa8565b92915050565b60006020820190506111536000830184610fb7565b92915050565b60006020820190508181036000830152611174818486610ff3565b90509392505050565b6000602082019050818103600083015261119681611059565b9050919050565b600060208201905081810360008301526111b68161107c565b9050919050565b600060208201905081810360008301526111d68161109f565b9050919050565b60006111e76111f8565b90506111f382826113da565b919050565b6000604051905090565b600067ffffffffffffffff82111561121d5761121c61140b565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156112495761124861140b565b5b61125282611467565b9050602081019050919050565b6000819050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000808335600160200384360303811261130a5761130961145d565b5b83810192508235915060208301925067ffffffffffffffff8211156113325761133161143a565b5b60018202360384131561134857611347611449565b5b509250929050565b600061135b82611378565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b82818337600083830152505050565b60005b838110156113c55780820151818401526020810190506113aa565b838111156113d4576000848401525b50505050565b6113e382611467565b810181811067ffffffffffffffff821117156114025761140161140b565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f54686520636f6e7472616374206973206c6f636b65642e000000000000000000600082015250565b7f54686520636f6e747261637420746f207570677261646520746f20686173207460008201527f6f20626520646966666572656e742066726f6d207468652063757272656e742060208201527f6d616e6167656d656e7420636f6e74726163742e000000000000000000000000604082015250565b7f4e6f7420616c6c6f77656420746f207570677261646520746865206d616e616760008201527f656d656e7420636f6e74726163742e0000000000000000000000000000000000602082015250565b61156e81611350565b811461157957600080fd5b50565b61158581611362565b811461159057600080fd5b50565b61159c8161136e565b81146115a757600080fd5b5056fea264697066735822122001e0b04de8d55c3deb395f7e8a600f0ed07dcdec96c5b5791d63e6e3affbb46a64736f6c63430008070033"); public static final Bytes DEFAULT_GROUP_MANAGEMENT_RUNTIME_BYTECODE = Bytes.fromHexString( - "608060405234801561001057600080fd5b50600436106100885760003560e01c8063a69df4b51161005b578063a69df4b51461014a578063b4926e2514610154578063f83d08ba14610222578063fd0177971461022c57610088565b80630d8e6e2c1461008d5780635aa68ac0146100ab57806378b903371461010a5780639738968c1461012a575b600080fd5b610095610270565b6040518082815260200191505060405180910390f35b6100b361027a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f65780820151818401526020810190506100db565b505050509050019250505060405180910390f35b6101126102d2565b60405180821515815260200191505060405180910390f35b6101326102e8565b60405180821515815260200191505060405180910390f35b61015261033f565b005b61020a6004803603602081101561016a57600080fd5b810190808035906020019064010000000081111561018757600080fd5b82018360208201111561019957600080fd5b803590602001918460208302840111640100000000831117156101bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610437565b60405180821515815260200191505060405180910390f35b61022a6105e3565b005b6102586004803603602081101561024257600080fd5b81019080803590602001909291905050506106d9565b60405180821515815260200191505060405180910390f35b6000600154905090565b606060028054806020026020016040519081016040528092919081815260200182805480156102c857602002820191906000526020600020905b8154815260200190600101908083116102b4575b5050505050905090565b60008060149054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614905090565b600060149054906101000a900460ff161561035957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161461041a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff021916908315150217905550565b60008060149054906101000a900460ff161561045257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156104e857326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146105a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b60006105b4836107d3565b90506001600060146101000a81548160ff0219169083151502179055506105d9610a0c565b5080915050919050565b600060149054906101000a900460ff166105fc57600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146106bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff021916908315150217905550565b60008060149054906101000a900460ff166106f357600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146107b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b60006107bf83610a96565b90506107c9610a0c565b5080915050919050565b6000806001905060005b8351811015610a02576108028482815181106107f557fe5b6020026020010151610b81565b156108a7577fcc7365305ae5f16c463d1383713d699f43c5548bbda5537ee61373ceb9aaf213600085838151811061083657fe5b6020026020010151604051808315158152602001828152602001806020018281038252601b8152602001807f4163636f756e7420697320616c72656164792061204d656d6265720000000000815250602001935050505060405180910390a18180156108a0575060005b91506109f5565b60006108c58583815181106108b857fe5b6020026020010151610ba1565b9050606081610909576040518060400160405280601b81526020017f4163636f756e7420697320616c72656164792061204d656d6265720000000000815250610923565b604051806060016040528060218152602001610c18602191395b90507fcc7365305ae5f16c463d1383713d699f43c5548bbda5537ee61373ceb9aaf2138287858151811061095357fe5b60200260200101518360405180841515815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109aa57808201518184015260208101905061098f565b50505050905090810190601f1680156109d75780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a18380156109f05750815b935050505b80806001019150506107dd565b5080915050919050565b60006001430340416002604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018280548015610a7057602002820191906000526020600020905b815481526020019060010190808311610a5c575b505093505050506040516020818303038152906040528051906020012060018190555090565b60008060036000848152602001908152602001600020549050600081118015610ac457506002805490508111155b15610b76576002805490508114610b32576000600260016002805490500381548110610aec57fe5b906000526020600020015490508060026001840381548110610b0a57fe5b9060005260206000200181905550816003600083815260200190815260200160002081905550505b6002805480610b3d57fe5b60019003818190600052602060002001600090559055600060036000858152602001908152602001600020819055506001915050610b7c565b60009150505b919050565b600080600360008481526020019081526020016000205414159050919050565b60008060036000848152602001908152602001600020541415610c0d576002829080600181540180825580915050600190039060005260206000200160009091909190915055600280549050600360008481526020019081526020016000208190555060019050610c12565b600090505b91905056fe4d656d626572206163636f756e74206164646564207375636365737366756c6c79a26469706673582212208c78668851cd6fd2c8c66c0f57ff99c07d7fa22aaac6e0806def9d467f320ecf64736f6c634300060c0033"); + "608060405234801561001057600080fd5b50600436106100885760003560e01c8063965a25ef1161005b578063965a25ef146101175780639738968c14610147578063a69df4b514610165578063f83d08ba1461016f57610088565b80630d8e6e2c1461008d5780631f52a8ee146100ab5780635aa68ac0146100db57806378b90337146100f9575b600080fd5b610095610179565b6040516100a291906111c5565b60405180910390f35b6100c560048036038101906100c09190610d38565b610183565b6040516100d2919061111e565b60405180910390f35b6100e361024b565b6040516100f091906110fc565b60405180910390f35b610101610324565b60405161010e919061111e565b60405180910390f35b610131600480360381019061012c9190610ceb565b61033a565b60405161013e919061111e565b60405180910390f35b61014f6104b4565b60405161015c919061111e565b60405180910390f35b61016d61050b565b005b6101776105d0565b005b6000600154905090565b60008060149054906101000a900460ff1661019d57600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161461022b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102229061121e565b60405180910390fd5b60006102378484610693565b90506102416107e6565b8091505092915050565b60606002805480602002602001604051908101604052809291908181526020016000905b8282101561031b57838290600052602060002001805461028e9061144d565b80601f01602080910402602001604051908101604052809291908181526020018280546102ba9061144d565b80156103075780601f106102dc57610100808354040283529160200191610307565b820191906000526020600020905b8154815290600101906020018083116102ea57829003601f168201915b50505050508152602001906001019061026f565b50505050905090565b60008060149054906101000a900460ff16905090565b60008060149054906101000a900460ff161561035557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156103eb57326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610479576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104709061121e565b60405180910390fd5b60006104858484610827565b90506001600060146101000a81548160ff0219169083151502179055506104aa6107e6565b8091505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614905090565b600060149054906101000a900460ff161561052557600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146105b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105aa9061121e565b60405180910390fd5b6001600060146101000a81548160ff021916908315150217905550565b600060149054906101000a900460ff166105e957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066e9061121e565b60405180910390fd5b60008060146101000a81548160ff021916908315150217905550565b600080600384846040516106a89291906110cc565b90815260200160405180910390205490506000811180156106ce57506002805490508111155b156107da57600280549050811461077a576000600260016002805490506106f59190611385565b8154811061070657610705611555565b5b9060005260206000200190508060026001846107229190611385565b8154811061073357610732611555565b5b906000526020600020019080546107499061144d565b610754929190610acf565b508160038260405161076691906110e5565b908152602001604051809103902081905550505b600280548061078c5761078b611526565b5b6001900381819060005260206000200160006107a89190610b5c565b90556000600385856040516107be9291906110cc565b90815260200160405180910390208190555060019150506107e0565b60009150505b92915050565b6001436107f39190611385565b40416002604051602001610809939291906111e0565b60405160208183030381529060405280519060200120600181905550565b6000806001905060005b848490508110156109f05761086985858381811061085257610851611555565b5b9050602002810190610864919061123e565b6109fb565b156108df577f1673b13ca99fc5f5d54f8ebc163339b3c03f5f661cec3f5dfe506fdbd2602de660008686848181106108a4576108a3611555565b5b90506020028101906108b6919061123e565b6040516108c593929190611180565b60405180910390a18180156108d8575060005b91506109dd565b600061090e8686848181106108f7576108f6611555565b5b9050602002810190610909919061123e565b610a29565b9050600081610952576040518060400160405280601b81526020017f4163636f756e7420697320616c72656164792061204d656d626572000000000081525061096c565b604051806060016040528060218152602001611610602191395b90507f1673b13ca99fc5f5d54f8ebc163339b3c03f5f661cec3f5dfe506fdbd2602de6828888868181106109a3576109a2611555565b5b90506020028101906109b5919061123e565b846040516109c69493929190611139565b60405180910390a18380156109d85750815b935050505b80806109e89061147f565b915050610831565b508091505092915050565b60008060038484604051610a109291906110cc565b9081526020016040518091039020541415905092915050565b60008060038484604051610a3e9291906110cc565b9081526020016040518091039020541415610ac4576002838390918060018154018082558091505060019003906000526020600020016000909192909192909192909192509190610a90929190610b9c565b5060028054905060038484604051610aa99291906110cc565b90815260200160405180910390208190555060019050610ac9565b600090505b92915050565b828054610adb9061144d565b90600052602060002090601f016020900481019282610afd5760008555610b4b565b82601f10610b0e5780548555610b4b565b82800160010185558215610b4b57600052602060002091601f016020900482015b82811115610b4a578254825591600101919060010190610b2f565b5b509050610b589190610c22565b5090565b508054610b689061144d565b6000825580601f10610b7a5750610b99565b601f016020900490600052602060002090810190610b989190610c22565b5b50565b828054610ba89061144d565b90600052602060002090601f016020900481019282610bca5760008555610c11565b82601f10610be357803560ff1916838001178555610c11565b82800160010185558215610c11579182015b82811115610c10578235825591602001919060010190610bf5565b5b509050610c1e9190610c22565b5090565b5b80821115610c3b576000816000905550600101610c23565b5090565b60008083601f840112610c5557610c54611589565b5b8235905067ffffffffffffffff811115610c7257610c71611584565b5b602083019150836020820283011115610c8e57610c8d611598565b5b9250929050565b60008083601f840112610cab57610caa611589565b5b8235905067ffffffffffffffff811115610cc857610cc7611584565b5b602083019150836001820283011115610ce457610ce3611598565b5b9250929050565b60008060208385031215610d0257610d016115a7565b5b600083013567ffffffffffffffff811115610d2057610d1f6115a2565b5b610d2c85828601610c3f565b92509250509250929050565b60008060208385031215610d4f57610d4e6115a7565b5b600083013567ffffffffffffffff811115610d6d57610d6c6115a2565b5b610d7985828601610c95565b92509250509250929050565b6000610d918383610f15565b905092915050565b6000610da58383610fcd565b905092915050565b610db6816113b9565b82525050565b6000610dc7826112f0565b610dd18185611336565b935083602082028501610de3856112a1565b8060005b85811015610e1f5784840389528151610e008582610d85565b9450610e0b8361131c565b925060208a01995050600181019050610de7565b50829750879550505050505092915050565b6000610e3c826112fb565b610e468185611336565b935083602082028501610e58856112b1565b8060005b85811015610e9357848403895281610e748582610d99565b9450610e7f83611329565b925060208a01995050600181019050610e5c565b50829750879550505050505092915050565b610eae816113cb565b82525050565b610ebd816113d7565b82525050565b6000610ecf8385611358565b9350610edc83858461140b565b610ee5836115ac565b840190509392505050565b6000610efc8385611369565b9350610f0983858461140b565b82840190509392505050565b6000610f2082611306565b610f2a8185611347565b9350610f3a81856020860161141a565b610f43816115ac565b840191505092915050565b60008154610f5b8161144d565b610f658186611369565b94506001821660008114610f805760018114610f9157610fc4565b60ff19831686528186019350610fc4565b610f9a856112db565b60005b83811015610fbc57815481890152600182019150602081019050610f9d565b838801955050505b50505092915050565b60008154610fda8161144d565b610fe48186611347565b94506001821660008114610fff576001811461101157611044565b60ff1983168652602086019350611044565b61101a856112c6565b60005b8381101561103c5781548189015260018201915060208101905061101d565b808801955050505b50505092915050565b600061105882611311565b6110628185611374565b935061107281856020860161141a565b61107b816115ac565b840191505092915050565b6000611093601583611374565b915061109e826115bd565b602082019050919050565b60006110b6601b83611374565b91506110c1826115e6565b602082019050919050565b60006110d9828486610ef0565b91508190509392505050565b60006110f18284610f4e565b915081905092915050565b600060208201905081810360008301526111168184610dbc565b905092915050565b60006020820190506111336000830184610ea5565b92915050565b600060608201905061114e6000830187610ea5565b8181036020830152611161818587610ec3565b90508181036040830152611175818461104d565b905095945050505050565b60006060820190506111956000830186610ea5565b81810360208301526111a8818486610ec3565b905081810360408301526111bb816110a9565b9050949350505050565b60006020820190506111da6000830184610eb4565b92915050565b60006060820190506111f56000830186610eb4565b6112026020830185610dad565b81810360408301526112148184610e31565b9050949350505050565b6000602082019050818103600083015261123781611086565b9050919050565b6000808335600160200384360303811261125b5761125a611593565b5b80840192508235915067ffffffffffffffff82111561127d5761127c61158e565b5b6020830192506001820236038313156112995761129861159d565b5b509250929050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081549050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000600182019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600061139082611401565b915061139b83611401565b9250828210156113ae576113ad6114c8565b5b828203905092915050565b60006113c4826113e1565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561143857808201518184015260208101905061141d565b83811115611447576000848401525b50505050565b6000600282049050600182168061146557607f821691505b60208210811415611479576114786114f7565b5b50919050565b600061148a82611401565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156114bd576114bc6114c8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4f726967696e206e6f7420746865206f776e65722e0000000000000000000000600082015250565b7f4163636f756e7420697320616c72656164792061204d656d626572000000000060008201525056fe4d656d626572206163636f756e74206164646564207375636365737366756c6c79a2646970667358221220c72b46f6338ebbdb7d6899962f7502c65afac97831e6ef969db5361611256b8d64736f6c63430008070033"); - public static final Bytes ADD_PARTICIPANTS_METHOD_SIGNATURE = Bytes.fromHexString("0xb4926e25"); + public static final Bytes ADD_PARTICIPANTS_METHOD_SIGNATURE = Bytes.fromHexString("0x965a25ef"); public static final Bytes CAN_EXECUTE_METHOD_SIGNATURE = Bytes.fromHexString("0x78b90337"); public static final Bytes GET_PARTICIPANTS_METHOD_SIGNATURE = Bytes.fromHexString("0x5aa68ac0"); public static final Bytes GET_VERSION_METHOD_SIGNATURE = Bytes.fromHexString("0x0d8e6e2c"); public static final Bytes LOCK_GROUP_METHOD_SIGNATURE = Bytes.fromHexString("0xf83d08ba"); - public static final Bytes REMOVE_PARTICIPANT_METHOD_SIGNATURE = Bytes.fromHexString("0xfd017797"); + public static final Bytes REMOVE_PARTICIPANT_METHOD_SIGNATURE = Bytes.fromHexString("0x1f52a8ee"); public static final Bytes UNLOCK_GROUP_METHOD_SIGNATURE = Bytes.fromHexString("0xa69df4b5"); } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/FlexiblePrivacyPrecompiledContractTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/FlexiblePrivacyPrecompiledContractTest.java index 248985e8337..ac252381dde 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/FlexiblePrivacyPrecompiledContractTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/FlexiblePrivacyPrecompiledContractTest.java @@ -312,9 +312,14 @@ public void testPrivateFromNotMemberOfGroup() { // array length too big assertThatComputeReturnsEmptyGivenContractMembershipQueryReturns( Bytes.concatenate( + // offset Bytes32.fromHexStringLenient("0x0"), // array length Bytes32.fromHexStringLenient("0x1"), + // offset + Bytes32.fromHexStringLenient("0x0"), + // member public key size + Bytes32.fromHexStringLenient("0x20"), // first array content Bytes32.fromHexStringLenient("0x1"))); } @@ -332,6 +337,10 @@ public void testInvalidResponseToMembershipQuery() { Bytes32.fromHexStringLenient("0x0"), // array length Bytes32.fromHexStringLenient("0x2"), + // offset + Bytes32.fromHexStringLenient("0x0"), + // member public key size + Bytes32.fromHexStringLenient("0x20"), // first array content Bytes32.fromHexStringLenient("0x1"))); } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyControllerTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyControllerTest.java index 32f77637373..7de7c121f8c 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyControllerTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyControllerTest.java @@ -99,11 +99,9 @@ public class FlexiblePrivacyControllerTest { private static final String TRANSACTION_KEY = "93Ky7lXwFkMc7+ckoFgUMku5bpr9tz4zhmWmk9RlNng="; private static final List PRIVACY_GROUP_ADDRESSES = List.of(ADDRESS1, ADDRESS2); - private static final Bytes SIMULATOR_RESULT_PREFIX = - Bytes.fromHexString( - "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002"); private static final Bytes SIMULATOR_RESULT = - Bytes.concatenate(SIMULATOR_RESULT_PREFIX, Base64.decode(ADDRESS1), Base64.decode(ADDRESS2)); + Bytes.fromHexString( + "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000020035695b4cc4b0941e60551d7a19cf30603db5bfc23e5ac43a56f57f25f75486a00000000000000000000000000000000000000000000000000000000000000202a8d9b56a0fe9cd94d60be4413bcb721d3a7be27ed8e28b3a6346df874ee141b"); private static final PrivacyGroup EXPECTED_PRIVACY_GROUP = new PrivacyGroup( PRIVACY_GROUP_ID, PrivacyGroup.Type.FLEXIBLE, "", "", PRIVACY_GROUP_ADDRESSES); @@ -197,7 +195,7 @@ public void verifiesGroupContainsUserId() { } @Test - public void findFleixblePrivacyGroups() { + public void findFlexiblePrivacyGroups() { mockingForFindPrivacyGroupByMembers(); mockingForFindPrivacyGroupById(); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java new file mode 100644 index 00000000000..64d074c7e5d --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java @@ -0,0 +1,87 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * 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.ethereum.privacy; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; + +import org.apache.tuweni.bytes.Bytes; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class FlexibleUtilTest { + + private static final String EXPECTED_EC_PARTICIPANT_1 = + "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES8nC4qT/KdoAoTSF3qs/47DUsDihyVbWiRjZAiyvqp9eSDkqV1RzlM+58oOwnpFRwvWNZM+AxMVxT+MvxdsqMA=="; + + private static final String EXPECTED_EC_PARTICIPANT_2 = + "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXIgZqRA25V+3nN+Do6b5r0jiUunub6ubjPhqwHpPxP44uUYh9RKCQNRnsqCJ9PjeTnC8R3ieJk7HWAlycU1bug=="; + + @Test + public void testGetParticipantsFromParameter() { + final String parameterNaCl = + "llol7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACADVpW0zEsJQeYFUdehnPMGA9tb/CPlrEOlb1fyX3VIagAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgKo2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs="; + final String expectedNaClParticipant1 = "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="; + final String expectedNaClParticipant2 = "Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs="; + + List actualParticipants = + FlexibleUtil.getParticipantsFromParameter(Bytes.fromBase64String(parameterNaCl)); + + assertThat(actualParticipants).hasSize(2); + assertThat(actualParticipants.get(0)).isEqualTo(expectedNaClParticipant1); + assertThat(actualParticipants.get(1)).isEqualTo(expectedNaClParticipant2); + + final String parameterEC = + "llol7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFswWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARLycLipP8p2gChNIXeqz/jsNSwOKHJVtaJGNkCLK+qn15IOSpXVHOUz7nyg7CekVHC9Y1kz4DExXFP4y/F2yowAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFyIGakQNuVft5zfg6Om+a9I4lLp7m+rm4z4asB6T8T+OLlGIfUSgkDUZ7KgifT43k5wvEd4niZOx1gJcnFNW7oAAAAAAA=="; + + actualParticipants = + FlexibleUtil.getParticipantsFromParameter(Bytes.fromBase64String(parameterEC)); + + assertThat(actualParticipants).hasSize(2); + assertThat(actualParticipants.get(0)).isEqualTo(EXPECTED_EC_PARTICIPANT_1); + assertThat(actualParticipants.get(1)).isEqualTo(EXPECTED_EC_PARTICIPANT_2); + + final String parameterEC2 = + "llol7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES8nC4qT/KdoAoTSF3qs/47DUsDihyVbWiRjZAiyvqp9eSDkqV1RzlM+58oOwnpFRwvWNZM+AxMVxT+MvxdsqMAAAAAAA"; + + actualParticipants = + FlexibleUtil.getParticipantsFromParameter(Bytes.fromBase64String(parameterEC2)); + + assertThat(actualParticipants).hasSize(1); + assertThat(actualParticipants.get(0)).isEqualTo(EXPECTED_EC_PARTICIPANT_1); + } + + @Test + public void testDecodeList() { + final Bytes rlpEncodedOneParticipant = + Bytes.fromBase64String( + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFswWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARLycLipP8p2gChNIXeqz/jsNSwOKHJVtaJGNkCLK+qn15IOSpXVHOUz7nyg7CekVHC9Y1kz4DExXFP4y/F2yowAAAAAAA="); + + List actualParticipants = FlexibleUtil.decodeList(rlpEncodedOneParticipant); + + assertThat(actualParticipants).isEqualTo(Arrays.asList(EXPECTED_EC_PARTICIPANT_1)); + + final Bytes wrongBytes = + Bytes.fromBase64String( + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="); + + actualParticipants = FlexibleUtil.decodeList(wrongBytes); + assertThat(actualParticipants).isEmpty(); + } +} diff --git a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultFlexiblePrivacyGroupManagementContract.java b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultFlexiblePrivacyGroupManagementContract.java index 73bfd458687..f7e349cb555 100644 --- a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultFlexiblePrivacyGroupManagementContract.java +++ b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultFlexiblePrivacyGroupManagementContract.java @@ -27,6 +27,7 @@ import org.web3j.abi.TypeReference; import org.web3j.abi.datatypes.Bool; import org.web3j.abi.datatypes.DynamicArray; +import org.web3j.abi.datatypes.DynamicBytes; import org.web3j.abi.datatypes.Event; import org.web3j.abi.datatypes.Type; import org.web3j.abi.datatypes.Utf8String; @@ -53,12 +54,12 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the codegen module to update. * - *

Generated with web3j version 4.5.16. + *

Generated with web3j version 1.4.1. */ @SuppressWarnings("rawtypes") public class DefaultFlexiblePrivacyGroupManagementContract extends Contract { public static final String BINARY = - "608060405234801561001057600080fd5b50610c6e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063a69df4b51161005b578063a69df4b51461014a578063b4926e2514610154578063f83d08ba14610222578063fd0177971461022c57610088565b80630d8e6e2c1461008d5780635aa68ac0146100ab57806378b903371461010a5780639738968c1461012a575b600080fd5b610095610270565b6040518082815260200191505060405180910390f35b6100b361027a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f65780820151818401526020810190506100db565b505050509050019250505060405180910390f35b6101126102d2565b60405180821515815260200191505060405180910390f35b6101326102e8565b60405180821515815260200191505060405180910390f35b61015261033f565b005b61020a6004803603602081101561016a57600080fd5b810190808035906020019064010000000081111561018757600080fd5b82018360208201111561019957600080fd5b803590602001918460208302840111640100000000831117156101bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610437565b60405180821515815260200191505060405180910390f35b61022a6105e3565b005b6102586004803603602081101561024257600080fd5b81019080803590602001909291905050506106d9565b60405180821515815260200191505060405180910390f35b6000600154905090565b606060028054806020026020016040519081016040528092919081815260200182805480156102c857602002820191906000526020600020905b8154815260200190600101908083116102b4575b5050505050905090565b60008060149054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614905090565b600060149054906101000a900460ff161561035957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161461041a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff021916908315150217905550565b60008060149054906101000a900460ff161561045257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156104e857326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146105a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b60006105b4836107d3565b90506001600060146101000a81548160ff0219169083151502179055506105d9610a0c565b5080915050919050565b600060149054906101000a900460ff166105fc57600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146106bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff021916908315150217905550565b60008060149054906101000a900460ff166106f357600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146107b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f726967696e206e6f7420746865206f776e65722e000000000000000000000081525060200191505060405180910390fd5b60006107bf83610a96565b90506107c9610a0c565b5080915050919050565b6000806001905060005b8351811015610a02576108028482815181106107f557fe5b6020026020010151610b81565b156108a7577fcc7365305ae5f16c463d1383713d699f43c5548bbda5537ee61373ceb9aaf213600085838151811061083657fe5b6020026020010151604051808315158152602001828152602001806020018281038252601b8152602001807f4163636f756e7420697320616c72656164792061204d656d6265720000000000815250602001935050505060405180910390a18180156108a0575060005b91506109f5565b60006108c58583815181106108b857fe5b6020026020010151610ba1565b9050606081610909576040518060400160405280601b81526020017f4163636f756e7420697320616c72656164792061204d656d6265720000000000815250610923565b604051806060016040528060218152602001610c18602191395b90507fcc7365305ae5f16c463d1383713d699f43c5548bbda5537ee61373ceb9aaf2138287858151811061095357fe5b60200260200101518360405180841515815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109aa57808201518184015260208101905061098f565b50505050905090810190601f1680156109d75780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a18380156109f05750815b935050505b80806001019150506107dd565b5080915050919050565b60006001430340416002604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018280548015610a7057602002820191906000526020600020905b815481526020019060010190808311610a5c575b505093505050506040516020818303038152906040528051906020012060018190555090565b60008060036000848152602001908152602001600020549050600081118015610ac457506002805490508111155b15610b76576002805490508114610b32576000600260016002805490500381548110610aec57fe5b906000526020600020015490508060026001840381548110610b0a57fe5b9060005260206000200181905550816003600083815260200190815260200160002081905550505b6002805480610b3d57fe5b60019003818190600052602060002001600090559055600060036000858152602001908152602001600020819055506001915050610b7c565b60009150505b919050565b600080600360008481526020019081526020016000205414159050919050565b60008060036000848152602001908152602001600020541415610c0d576002829080600181540180825580915050600190039060005260206000200160009091909190915055600280549050600360008481526020019081526020016000208190555060019050610c12565b600090505b91905056fe4d656d626572206163636f756e74206164646564207375636365737366756c6c79a2646970667358221220aaa2dd79ed65e1a55d25832a79d0bd9f47b1b0bae7b719d96723f776987a93b264736f6c634300060c0033"; + "608060405234801561001057600080fd5b50611666806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063965a25ef1161005b578063965a25ef146101175780639738968c14610147578063a69df4b514610165578063f83d08ba1461016f57610088565b80630d8e6e2c1461008d5780631f52a8ee146100ab5780635aa68ac0146100db57806378b90337146100f9575b600080fd5b610095610179565b6040516100a29190610c58565b60405180910390f35b6100c560048036038101906100c09190610ce2565b610183565b6040516100d29190610d4a565b60405180910390f35b6100e361024b565b6040516100f09190610ec0565b60405180910390f35b610101610324565b60405161010e9190610d4a565b60405180910390f35b610131600480360381019061012c9190610f38565b61033a565b60405161013e9190610d4a565b60405180910390f35b61014f6104b4565b60405161015c9190610d4a565b60405180910390f35b61016d61050b565b005b6101776105d0565b005b6000600154905090565b60008060149054906101000a900460ff1661019d57600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161461022b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161022290610fe2565b60405180910390fd5b60006102378484610693565b90506102416107e6565b8091505092915050565b60606002805480602002602001604051908101604052809291908181526020016000905b8282101561031b57838290600052602060002001805461028e90611031565b80601f01602080910402602001604051908101604052809291908181526020018280546102ba90611031565b80156103075780601f106102dc57610100808354040283529160200191610307565b820191906000526020600020905b8154815290600101906020018083116102ea57829003601f168201915b50505050508152602001906001019061026f565b50505050905090565b60008060149054906101000a900460ff16905090565b60008060149054906101000a900460ff161561035557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156103eb57326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610479576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047090610fe2565b60405180910390fd5b60006104858484610827565b90506001600060146101000a81548160ff0219169083151502179055506104aa6107e6565b8091505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614905090565b600060149054906101000a900460ff161561052557600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146105b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105aa90610fe2565b60405180910390fd5b6001600060146101000a81548160ff021916908315150217905550565b600060149054906101000a900460ff166105e957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066e90610fe2565b60405180910390fd5b60008060146101000a81548160ff021916908315150217905550565b600080600384846040516106a89291906110a2565b90815260200160405180910390205490506000811180156106ce57506002805490508111155b156107da57600280549050811461077a576000600260016002805490506106f591906110f4565b8154811061070657610705611128565b5b90600052602060002001905080600260018461072291906110f4565b8154811061073357610732611128565b5b9060005260206000200190805461074990611031565b610754929190610acf565b508160038260405161076691906111eb565b908152602001604051809103902081905550505b600280548061078c5761078b611202565b5b6001900381819060005260206000200160006107a89190610b5c565b90556000600385856040516107be9291906110a2565b90815260200160405180910390208190555060019150506107e0565b60009150505b92915050565b6001436107f391906110f4565b40416002604051602001610809939291906113bc565b60405160208183030381529060405280519060200120600181905550565b6000806001905060005b848490508110156109f05761086985858381811061085257610851611128565b5b90506020028101906108649190611409565b6109fb565b156108df577f1673b13ca99fc5f5d54f8ebc163339b3c03f5f661cec3f5dfe506fdbd2602de660008686848181106108a4576108a3611128565b5b90506020028101906108b69190611409565b6040516108c5939291906114f6565b60405180910390a18180156108d8575060005b91506109dd565b600061090e8686848181106108f7576108f6611128565b5b90506020028101906109099190611409565b610a29565b9050600081610952576040518060400160405280601b81526020017f4163636f756e7420697320616c72656164792061204d656d626572000000000081525061096c565b604051806060016040528060218152602001611610602191395b90507f1673b13ca99fc5f5d54f8ebc163339b3c03f5f661cec3f5dfe506fdbd2602de6828888868181106109a3576109a2611128565b5b90506020028101906109b59190611409565b846040516109c6949392919061157f565b60405180910390a18380156109d85750815b935050505b80806109e8906115c6565b915050610831565b508091505092915050565b60008060038484604051610a109291906110a2565b9081526020016040518091039020541415905092915050565b60008060038484604051610a3e9291906110a2565b9081526020016040518091039020541415610ac4576002838390918060018154018082558091505060019003906000526020600020016000909192909192909192909192509190610a90929190610b9c565b5060028054905060038484604051610aa99291906110a2565b90815260200160405180910390208190555060019050610ac9565b600090505b92915050565b828054610adb90611031565b90600052602060002090601f016020900481019282610afd5760008555610b4b565b82601f10610b0e5780548555610b4b565b82800160010185558215610b4b57600052602060002091601f016020900482015b82811115610b4a578254825591600101919060010190610b2f565b5b509050610b589190610c22565b5090565b508054610b6890611031565b6000825580601f10610b7a5750610b99565b601f016020900490600052602060002090810190610b989190610c22565b5b50565b828054610ba890611031565b90600052602060002090601f016020900481019282610bca5760008555610c11565b82601f10610be357803560ff1916838001178555610c11565b82800160010185558215610c11579182015b82811115610c10578235825591602001919060010190610bf5565b5b509050610c1e9190610c22565b5090565b5b80821115610c3b576000816000905550600101610c23565b5090565b6000819050919050565b610c5281610c3f565b82525050565b6000602082019050610c6d6000830184610c49565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610ca257610ca1610c7d565b5b8235905067ffffffffffffffff811115610cbf57610cbe610c82565b5b602083019150836001820283011115610cdb57610cda610c87565b5b9250929050565b60008060208385031215610cf957610cf8610c73565b5b600083013567ffffffffffffffff811115610d1757610d16610c78565b5b610d2385828601610c8c565b92509250509250929050565b60008115159050919050565b610d4481610d2f565b82525050565b6000602082019050610d5f6000830184610d3b565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610dcb578082015181840152602081019050610db0565b83811115610dda576000848401525b50505050565b6000601f19601f8301169050919050565b6000610dfc82610d91565b610e068185610d9c565b9350610e16818560208601610dad565b610e1f81610de0565b840191505092915050565b6000610e368383610df1565b905092915050565b6000602082019050919050565b6000610e5682610d65565b610e608185610d70565b935083602082028501610e7285610d81565b8060005b85811015610eae5784840389528151610e8f8582610e2a565b9450610e9a83610e3e565b925060208a01995050600181019050610e76565b50829750879550505050505092915050565b60006020820190508181036000830152610eda8184610e4b565b905092915050565b60008083601f840112610ef857610ef7610c7d565b5b8235905067ffffffffffffffff811115610f1557610f14610c82565b5b602083019150836020820283011115610f3157610f30610c87565b5b9250929050565b60008060208385031215610f4f57610f4e610c73565b5b600083013567ffffffffffffffff811115610f6d57610f6c610c78565b5b610f7985828601610ee2565b92509250509250929050565b600082825260208201905092915050565b7f4f726967696e206e6f7420746865206f776e65722e0000000000000000000000600082015250565b6000610fcc601583610f85565b9150610fd782610f96565b602082019050919050565b60006020820190508181036000830152610ffb81610fbf565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061104957607f821691505b6020821081141561105d5761105c611002565b5b50919050565b600081905092915050565b82818337600083830152505050565b60006110898385611063565b935061109683858461106e565b82840190509392505050565b60006110af82848661107d565b91508190509392505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006110ff826110bb565b915061110a836110bb565b92508282101561111d5761111c6110c5565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008190508160005260206000209050919050565b6000815461117981611031565b6111838186611063565b9450600182166000811461119e57600181146111af576111e2565b60ff198316865281860193506111e2565b6111b885611157565b60005b838110156111da578154818901526001820191506020810190506111bb565b838801955050505b50505092915050565b60006111f7828461116c565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061125c82611231565b9050919050565b61126c81611251565b82525050565b600081549050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081546112b481611031565b6112be8186610d9c565b945060018216600081146112d957600181146112eb5761131e565b60ff198316865260208601935061131e565b6112f485611292565b60005b83811015611316578154818901526001820191506020810190506112f7565b808801955050505b50505092915050565b600061133383836112a7565b905092915050565b6000600182019050919050565b600061135382611272565b61135d8185610d70565b93508360208202850161136f8561127d565b8060005b858110156113aa5784840389528161138b8582611327565b94506113968361133b565b925060208a01995050600181019050611373565b50829750879550505050505092915050565b60006060820190506113d16000830186610c49565b6113de6020830185611263565b81810360408301526113f08184611348565b9050949350505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611426576114256113fa565b5b80840192508235915067ffffffffffffffff821115611448576114476113ff565b5b60208301925060018202360383131561146457611463611404565b5b509250929050565b600082825260208201905092915050565b6000611489838561146c565b935061149683858461106e565b61149f83610de0565b840190509392505050565b7f4163636f756e7420697320616c72656164792061204d656d6265720000000000600082015250565b60006114e0601b83610f85565b91506114eb826114aa565b602082019050919050565b600060608201905061150b6000830186610d3b565b818103602083015261151e81848661147d565b90508181036040830152611531816114d3565b9050949350505050565b600081519050919050565b60006115518261153b565b61155b8185610f85565b935061156b818560208601610dad565b61157481610de0565b840191505092915050565b60006060820190506115946000830187610d3b565b81810360208301526115a781858761147d565b905081810360408301526115bb8184611546565b905095945050505050565b60006115d1826110bb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611604576116036110c5565b5b60018201905091905056fe4d656d626572206163636f756e74206164646564207375636365737366756c6c79a2646970667358221220d3a7456a07fdf8421729e71e971f6d0cb06adecd41665ab8a87c08377118ad1664736f6c634300080c0033"; public static final String FUNC_ADDPARTICIPANTS = "addParticipants"; @@ -81,8 +82,9 @@ public class DefaultFlexiblePrivacyGroupManagementContract extends Contract { "ParticipantAdded", Arrays.>asList( new TypeReference() {}, - new TypeReference() {}, + new TypeReference() {}, new TypeReference() {})); + ; @Deprecated protected DefaultFlexiblePrivacyGroupManagementContract( @@ -171,10 +173,10 @@ public RemoteFunctionCall addParticipants(List _publ new org.web3j.abi.datatypes.Function( FUNC_ADDPARTICIPANTS, Arrays.asList( - new org.web3j.abi.datatypes.DynamicArray( - org.web3j.abi.datatypes.generated.Bytes32.class, + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.DynamicBytes.class, org.web3j.abi.Utils.typeMap( - _publicEnclaveKeys, org.web3j.abi.datatypes.generated.Bytes32.class))), + _publicEnclaveKeys, org.web3j.abi.datatypes.DynamicBytes.class))), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -188,11 +190,13 @@ public RemoteFunctionCall canExecute() { return executeRemoteCallSingleValueReturn(function, Boolean.class); } - public RemoteFunctionCall canUpgrade() { + public RemoteFunctionCall canUpgrade() { final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function( - FUNC_CANUPGRADE, Arrays.asList(), Collections.>emptyList()); - return executeRemoteCallTransaction(function); + FUNC_CANUPGRADE, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall getParticipants() { @@ -200,7 +204,7 @@ public RemoteFunctionCall getParticipants() { new org.web3j.abi.datatypes.Function( FUNC_GETPARTICIPANTS, Arrays.asList(), - Arrays.>asList(new TypeReference>() {})); + Arrays.>asList(new TypeReference>() {})); return new RemoteFunctionCall( function, new Callable() { @@ -233,7 +237,7 @@ public RemoteFunctionCall removeParticipant(byte[] _particip final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function( FUNC_REMOVEPARTICIPANT, - Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(_participant)), + Arrays.asList(new org.web3j.abi.datatypes.DynamicBytes(_participant)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } diff --git a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementInterface.java b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementInterface.java index 76738026cd8..dff393c2a16 100644 --- a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementInterface.java +++ b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementInterface.java @@ -23,6 +23,7 @@ import org.web3j.abi.TypeReference; import org.web3j.abi.datatypes.Bool; import org.web3j.abi.datatypes.DynamicArray; +import org.web3j.abi.datatypes.DynamicBytes; import org.web3j.abi.datatypes.Function; import org.web3j.abi.datatypes.Type; import org.web3j.abi.datatypes.generated.Bytes32; @@ -44,7 +45,7 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the codegen module to update. * - *

Generated with web3j version 4.5.16. + *

Generated with web3j version 1.4.1. */ @SuppressWarnings("rawtypes") public class FlexiblePrivacyGroupManagementInterface extends Contract { @@ -107,10 +108,10 @@ public RemoteFunctionCall addParticipants(List publi new Function( FUNC_ADDPARTICIPANTS, Arrays.asList( - new org.web3j.abi.datatypes.DynamicArray( - org.web3j.abi.datatypes.generated.Bytes32.class, + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.DynamicBytes.class, org.web3j.abi.Utils.typeMap( - publicEnclaveKeys, org.web3j.abi.datatypes.generated.Bytes32.class))), + publicEnclaveKeys, org.web3j.abi.datatypes.DynamicBytes.class))), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -136,7 +137,7 @@ public RemoteFunctionCall getParticipants() { new Function( FUNC_GETPARTICIPANTS, Arrays.asList(), - Arrays.>asList(new TypeReference>() {})); + Arrays.>asList(new TypeReference>() {})); return new RemoteFunctionCall( function, new Callable() { @@ -168,7 +169,7 @@ public RemoteFunctionCall removeParticipant(byte[] participa final Function function = new Function( FUNC_REMOVEPARTICIPANT, - Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(participant)), + Arrays.asList(new org.web3j.abi.datatypes.DynamicBytes(participant)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } diff --git a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementProxy.java b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementProxy.java index 96b22afe95c..4b94feb919d 100644 --- a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementProxy.java +++ b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/FlexiblePrivacyGroupManagementProxy.java @@ -29,6 +29,7 @@ import org.web3j.abi.datatypes.Address; import org.web3j.abi.datatypes.Bool; import org.web3j.abi.datatypes.DynamicArray; +import org.web3j.abi.datatypes.DynamicBytes; import org.web3j.abi.datatypes.Event; import org.web3j.abi.datatypes.Type; import org.web3j.abi.datatypes.generated.Bytes32; @@ -54,12 +55,12 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the codegen module to update. * - *

Generated with web3j version 4.5.16. + *

Generated with web3j version 1.4.1. */ @SuppressWarnings("rawtypes") public class FlexiblePrivacyGroupManagementProxy extends Contract { public static final String BINARY = - "608060405234801561001057600080fd5b50604051610fa6380380610fa68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610f12806100946000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80639738968c116100665780639738968c146101b8578063a69df4b5146101d8578063b4926e25146101e2578063f83d08ba146102b0578063fd017797146102ba5761009e565b80630d8e6e2c146100a35780633659cfe6146100c15780635aa68ac0146101055780635c60da1b1461016457806378b9033714610198575b600080fd5b6100ab6102fe565b6040518082815260200191505060405180910390f35b610103600480360360208110156100d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103ab565b005b61010d61083e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610150578082015181840152602081019050610135565b505050509050019250505060405180910390f35b61016c610987565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101a06109ab565b60405180821515815260200191505060405180910390f35b6101c0610a58565b60405180821515815260200191505060405180910390f35b6101e0610b07565b005b610298600480360360208110156101f857600080fd5b810190808035906020019064010000000081111561021557600080fd5b82018360208201111561022757600080fd5b8035906020019184602083028401116401000000008311171561024957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610b90565b60405180821515815260200191505060405180910390f35b6102b8610c8d565b005b6102e6600480360360208110156102d057600080fd5b8101908080359060200190929190505050610d16565b60405180821515815260200191505060405180910390f35b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16630d8e6e2c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561036a57600080fd5b505afa15801561037e573d6000803e3d6000fd5b505050506040513d602081101561039457600080fd5b810190808051906020019092919050505091505090565b3073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f157600080fd5b505afa158015610405573d6000803e3d6000fd5b505050506040513d602081101561041b57600080fd5b810190808051906020019092919050505061049e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f54686520636f6e7472616374206973206c6f636b65642e00000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610543576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526054815260200180610e5a6054913960600191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561058b57600080fd5b505af115801561059f573d6000803e3d6000fd5b505050506040513d60208110156105b557600080fd5b810190808051906020019092919050505061061b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610eae602f913960400191505060405180910390fd5b60603073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b815260040160006040518083038186803b15801561066357600080fd5b505afa158015610677573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156106a157600080fd5b81019080805160405193929190846401000000008211156106c157600080fd5b838201915060208201858111156106d757600080fd5b82518660208202830111640100000000821117156106f457600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561072b578082015181840152602081019050610710565b50505050905001604052505050905061074382610e16565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663b4926e25836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b838110156107d85780820151818401526020810190506107bd565b5050505090500192505050602060405180830381600087803b1580156107fd57600080fd5b505af1158015610811573d6000803e3d6000fd5b505050506040513d602081101561082757600080fd5b810190808051906020019092919050505050505050565b606060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b815260040160006040518083038186803b1580156108ac57600080fd5b505afa1580156108c0573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156108ea57600080fd5b810190808051604051939291908464010000000082111561090a57600080fd5b8382019150602082018581111561092057600080fd5b825186602082028301116401000000008211171561093d57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015610974578082015181840152602081019050610959565b5050505090500160405250505091505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b815260040160206040518083038186803b158015610a1757600080fd5b505afa158015610a2b573d6000803e3d6000fd5b505050506040513d6020811015610a4157600080fd5b810190808051906020019092919050505091505090565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610ac657600080fd5b505af1158015610ada573d6000803e3d6000fd5b505050506040513d6020811015610af057600080fd5b810190808051906020019092919050505091505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a69df4b56040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b5050505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663b4926e25846040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b83811015610c25578082015181840152602081019050610c0a565b5050505090500192505050602060405180830381600087803b158015610c4a57600080fd5b505af1158015610c5e573d6000803e3d6000fd5b505050506040513d6020811015610c7457600080fd5b8101908080519060200190929190505050915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663f83d08ba6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610cfb57600080fd5b505af1158015610d0f573d6000803e3d6000fd5b5050505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1663fd017797856040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015610d9157600080fd5b505af1158015610da5573d6000803e3d6000fd5b505050506040513d6020811015610dbb57600080fd5b810190808051906020019092919050505090508015610e0c577fef2df0cc0f44b5a36a7de9951ef49ba4d861649244ff89bcf7ffaa1ac7291e89846040518082815260200191505060405180910390a15b8092505050919050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe54686520636f6e747261637420746f207570677261646520746f2068617320746f20626520646966666572656e742066726f6d207468652063757272656e74206d616e6167656d656e7420636f6e74726163742e4e6f7420616c6c6f77656420746f207570677261646520746865206d616e6167656d656e7420636f6e74726163742ea26469706673582212207d77b2288fb78b354ca3a252d7513de3d808fcaa42e73f475b95f412c24a314f64736f6c634300060c0033"; + "60806040523480156200001157600080fd5b506040516200166d3803806200166d8339818101604052810190620000379190620000e8565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200011a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000b08262000083565b9050919050565b620000c281620000a3565b8114620000ce57600080fd5b50565b600081519050620000e281620000b7565b92915050565b6000602082840312156200010157620001006200007e565b5b60006200011184828501620000d1565b91505092915050565b611543806200012a6000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c806378b903371161006657806378b9033714610149578063965a25ef146101675780639738968c14610197578063a69df4b5146101b5578063f83d08ba146101bf5761009e565b80630d8e6e2c146100a35780631f52a8ee146100c15780633659cfe6146100f15780635aa68ac01461010d5780635c60da1b1461012b575b600080fd5b6100ab6101c9565b6040516100b89190610a86565b60405180910390f35b6100db60048036038101906100d69190610b1a565b610264565b6040516100e89190610b82565b60405180910390f35b61010b60048036038101906101069190610bfb565b610357565b005b61011561066d565b6040516101229190610d83565b60405180910390f35b61013361070f565b6040516101409190610db4565b60405180910390f35b610151610733565b60405161015e9190610b82565b60405180910390f35b610181600480360381019061017c9190610e25565b6107ce565b60405161018e9190610b82565b60405180910390f35b61019f61087b565b6040516101ac9190610b82565b60405180910390f35b6101bd610918565b005b6101c76109a1565b005b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16630d8e6e2c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610e9e565b91505090565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16631f52a8ee86866040518363ffffffff1660e01b81526004016102c7929190610f18565b6020604051808303816000875af11580156102e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030a9190610f68565b9050801561034c577f52213552a930e6de0c0d7df74ece31dac1306b2c7e200ceded7a4442853189b58585604051610343929190610f18565b60405180910390a15b809250505092915050565b3073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c69190610f68565b610405576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103fc90610ff2565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048b906110aa565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156104e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105059190610f68565b610544576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053b9061113c565b60405180910390fd5b60003073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b8152600401600060405180830381865afa158015610591573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906105ba919061135e565b90506105c582610a2a565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663965a25ef836040518263ffffffff1660e01b81526004016106249190610d83565b6020604051808303816000875af1158015610643573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106679190610f68565b50505050565b606060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16635aa68ac06040518163ffffffff1660e01b8152600401600060405180830381865afa1580156106e0573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610709919061135e565b91505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166378b903376040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c89190610f68565b91505090565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663965a25ef85856040518363ffffffff1660e01b815260040161082f9291906114e9565b6020604051808303816000875af115801561084e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108729190610f68565b91505092915050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16639738968c6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156108ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109129190610f68565b91505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a69df4b56040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561098657600080fd5b505af115801561099a573d6000803e3d6000fd5b5050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663f83d08ba6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b5050505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000819050919050565b610a8081610a6d565b82525050565b6000602082019050610a9b6000830184610a77565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610ada57610ad9610ab5565b5b8235905067ffffffffffffffff811115610af757610af6610aba565b5b602083019150836001820283011115610b1357610b12610abf565b5b9250929050565b60008060208385031215610b3157610b30610aab565b5b600083013567ffffffffffffffff811115610b4f57610b4e610ab0565b5b610b5b85828601610ac4565b92509250509250929050565b60008115159050919050565b610b7c81610b67565b82525050565b6000602082019050610b976000830184610b73565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610bc882610b9d565b9050919050565b610bd881610bbd565b8114610be357600080fd5b50565b600081359050610bf581610bcf565b92915050565b600060208284031215610c1157610c10610aab565b5b6000610c1f84828501610be6565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610c8e578082015181840152602081019050610c73565b83811115610c9d576000848401525b50505050565b6000601f19601f8301169050919050565b6000610cbf82610c54565b610cc98185610c5f565b9350610cd9818560208601610c70565b610ce281610ca3565b840191505092915050565b6000610cf98383610cb4565b905092915050565b6000602082019050919050565b6000610d1982610c28565b610d238185610c33565b935083602082028501610d3585610c44565b8060005b85811015610d715784840389528151610d528582610ced565b9450610d5d83610d01565b925060208a01995050600181019050610d39565b50829750879550505050505092915050565b60006020820190508181036000830152610d9d8184610d0e565b905092915050565b610dae81610bbd565b82525050565b6000602082019050610dc96000830184610da5565b92915050565b60008083601f840112610de557610de4610ab5565b5b8235905067ffffffffffffffff811115610e0257610e01610aba565b5b602083019150836020820283011115610e1e57610e1d610abf565b5b9250929050565b60008060208385031215610e3c57610e3b610aab565b5b600083013567ffffffffffffffff811115610e5a57610e59610ab0565b5b610e6685828601610dcf565b92509250509250929050565b610e7b81610a6d565b8114610e8657600080fd5b50565b600081519050610e9881610e72565b92915050565b600060208284031215610eb457610eb3610aab565b5b6000610ec284828501610e89565b91505092915050565b600082825260208201905092915050565b82818337600083830152505050565b6000610ef78385610ecb565b9350610f04838584610edc565b610f0d83610ca3565b840190509392505050565b60006020820190508181036000830152610f33818486610eeb565b90509392505050565b610f4581610b67565b8114610f5057600080fd5b50565b600081519050610f6281610f3c565b92915050565b600060208284031215610f7e57610f7d610aab565b5b6000610f8c84828501610f53565b91505092915050565b600082825260208201905092915050565b7f54686520636f6e7472616374206973206c6f636b65642e000000000000000000600082015250565b6000610fdc601783610f95565b9150610fe782610fa6565b602082019050919050565b6000602082019050818103600083015261100b81610fcf565b9050919050565b7f54686520636f6e747261637420746f207570677261646520746f20686173207460008201527f6f20626520646966666572656e742066726f6d207468652063757272656e742060208201527f6d616e6167656d656e7420636f6e74726163742e000000000000000000000000604082015250565b6000611094605483610f95565b915061109f82611012565b606082019050919050565b600060208201905081810360008301526110c381611087565b9050919050565b7f4e6f7420616c6c6f77656420746f207570677261646520746865206d616e616760008201527f656d656e7420636f6e74726163742e0000000000000000000000000000000000602082015250565b6000611126602f83610f95565b9150611131826110ca565b604082019050919050565b6000602082019050818103600083015261115581611119565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61119482610ca3565b810181811067ffffffffffffffff821117156111b3576111b261115c565b5b80604052505050565b60006111c6610aa1565b90506111d2828261118b565b919050565b600067ffffffffffffffff8211156111f2576111f161115c565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff8211156112235761122261115c565b5b61122c82610ca3565b9050602081019050919050565b600061124c61124784611208565b6111bc565b90508281526020810184848401111561126857611267611203565b5b611273848285610c70565b509392505050565b600082601f8301126112905761128f610ab5565b5b81516112a0848260208601611239565b91505092915050565b60006112bc6112b7846111d7565b6111bc565b905080838252602082019050602084028301858111156112df576112de610abf565b5b835b8181101561132657805167ffffffffffffffff81111561130457611303610ab5565b5b808601611311898261127b565b855260208501945050506020810190506112e1565b5050509392505050565b600082601f83011261134557611344610ab5565b5b81516113558482602086016112a9565b91505092915050565b60006020828403121561137457611373610aab565b5b600082015167ffffffffffffffff81111561139257611391610ab0565b5b61139e84828501611330565b91505092915050565b6000819050919050565b60006113bd8385610c5f565b93506113ca838584610edc565b6113d383610ca3565b840190509392505050565b60006113eb8484846113b1565b90509392505050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126114205761141f6113fe565b5b83810192508235915060208301925067ffffffffffffffff821115611448576114476113f4565b5b60018202360384131561145e5761145d6113f9565b5b509250929050565b6000602082019050919050565b600061147f8385610c33565b935083602084028501611491846113a7565b8060005b878110156114d75784840389526114ac8284611403565b6114b78682846113de565b95506114c284611466565b935060208b019a505050600181019050611495565b50829750879450505050509392505050565b60006020820190508181036000830152611504818486611473565b9050939250505056fea2646970667358221220d7eefee8f20c9de5911bbd7081429d08304b75cc59dda600e9adae257a50bdf664736f6c634300080c0033"; public static final String FUNC_ADDPARTICIPANTS = "addParticipants"; @@ -83,7 +84,9 @@ public class FlexiblePrivacyGroupManagementProxy extends Contract { public static final Event PARTICIPANTREMOVED_EVENT = new Event( - "ParticipantRemoved", Arrays.>asList(new TypeReference() {})); + "ParticipantRemoved", + Arrays.>asList(new TypeReference() {})); + ; @Deprecated protected FlexiblePrivacyGroupManagementProxy( @@ -168,10 +171,10 @@ public RemoteFunctionCall addParticipants(List _publ new org.web3j.abi.datatypes.Function( FUNC_ADDPARTICIPANTS, Arrays.asList( - new org.web3j.abi.datatypes.DynamicArray( - org.web3j.abi.datatypes.generated.Bytes32.class, + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.DynamicBytes.class, org.web3j.abi.Utils.typeMap( - _publicEnclaveKeys, org.web3j.abi.datatypes.generated.Bytes32.class))), + _publicEnclaveKeys, org.web3j.abi.datatypes.DynamicBytes.class))), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -197,7 +200,7 @@ public RemoteFunctionCall getParticipants() { new org.web3j.abi.datatypes.Function( FUNC_GETPARTICIPANTS, Arrays.asList(), - Arrays.>asList(new TypeReference>() {})); + Arrays.>asList(new TypeReference>() {})); return new RemoteFunctionCall( function, new Callable() { @@ -239,7 +242,7 @@ public RemoteFunctionCall removeParticipant(byte[] _particip final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function( FUNC_REMOVEPARTICIPANT, - Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(_participant)), + Arrays.asList(new org.web3j.abi.datatypes.DynamicBytes(_participant)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } diff --git a/privacy-contracts/src/main/solidity/DefaultFlexiblePrivacyGroupManagementContract.sol b/privacy-contracts/src/main/solidity/DefaultFlexiblePrivacyGroupManagementContract.sol index 2ca8a511ece..a667a04c35f 100644 --- a/privacy-contracts/src/main/solidity/DefaultFlexiblePrivacyGroupManagementContract.sol +++ b/privacy-contracts/src/main/solidity/DefaultFlexiblePrivacyGroupManagementContract.sol @@ -12,7 +12,8 @@ * * SPDX-License-Identifier: Apache-2.0 */ -pragma solidity ^0.6.0; +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; import "./FlexiblePrivacyGroupManagementInterface.sol"; contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupManagementInterface { @@ -20,8 +21,8 @@ contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupMa address private _owner; bool private _canExecute; bytes32 private _version; - bytes32[] private distributionList; - mapping(bytes32 => uint256) private distributionIndexOf; + bytes[] private distributionList; + mapping(bytes => uint256) private distributionIndexOf; function getVersion() external view override returns (bytes32) { return _version; @@ -43,10 +44,10 @@ contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupMa _canExecute = true; } - function addParticipants(bytes32[] memory _publicEnclaveKeys) public override returns (bool) { + function addParticipants(bytes[] calldata _publicEnclaveKeys) public override returns (bool) { require(!_canExecute); if (_owner == address(0x0)) { - // The account creating this group is set to be the owner + // The account creating this group is set to be the owner _owner = tx.origin; } require(tx.origin == _owner, "Origin not the owner."); @@ -56,7 +57,7 @@ contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupMa return result; } - function removeParticipant(bytes32 _participant) public override returns (bool) { + function removeParticipant(bytes calldata _participant) public override returns (bool) { require(_canExecute); require(tx.origin == _owner, "Origin not the owner."); bool result = removeInternal(_participant); @@ -64,17 +65,17 @@ contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupMa return result; } - function getParticipants() public view override returns (bytes32[] memory) { + function getParticipants() public view override returns (bytes[] memory) { return distributionList; } - function canUpgrade() external override returns (bool) { + function canUpgrade() external view override returns (bool) { return tx.origin == _owner; } //internal functions - function addAll(bytes32[] memory _publicEnclaveKeys) internal returns (bool) { + function addAll(bytes[] calldata _publicEnclaveKeys) internal returns (bool) { bool allAdded = true; for (uint i = 0; i < _publicEnclaveKeys.length; i++) { if (isMember(_publicEnclaveKeys[i])) { @@ -90,11 +91,11 @@ contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupMa return allAdded; } - function isMember(bytes32 _publicEnclaveKey) internal view returns (bool) { + function isMember(bytes calldata _publicEnclaveKey) internal view returns (bool) { return distributionIndexOf[_publicEnclaveKey] != 0; } - function addParticipant(bytes32 _publicEnclaveKey) internal returns (bool) { + function addParticipant(bytes calldata _publicEnclaveKey) internal returns (bool) { if (distributionIndexOf[_publicEnclaveKey] == 0) { distributionList.push(_publicEnclaveKey); distributionIndexOf[_publicEnclaveKey] = distributionList.length; @@ -103,12 +104,12 @@ contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupMa return false; } - function removeInternal(bytes32 _participant) internal returns (bool) { + function removeInternal(bytes calldata _participant) internal returns (bool) { uint256 index = distributionIndexOf[_participant]; if (index > 0 && index <= distributionList.length) { //move last address into index being vacated (unless we are dealing with last index) if (index != distributionList.length) { - bytes32 lastPublicKey = distributionList[distributionList.length - 1]; + bytes storage lastPublicKey = distributionList[distributionList.length - 1]; distributionList[index - 1] = lastPublicKey; distributionIndexOf[lastPublicKey] = index; } @@ -119,13 +120,13 @@ contract DefaultFlexiblePrivacyGroupManagementContract is FlexiblePrivacyGroupMa return false; } - function updateVersion() internal returns (int) { - _version = keccak256(abi.encodePacked(blockhash(block.number-1), block.coinbase, distributionList)); + function updateVersion() internal { + _version = keccak256(abi.encode(blockhash(block.number-1), block.coinbase, distributionList)); } event ParticipantAdded( bool success, - bytes32 publicEnclaveKey, + bytes publicEnclaveKey, string message ); } diff --git a/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementInterface.sol b/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementInterface.sol index 45a4104347e..0b3131bef9f 100644 --- a/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementInterface.sol +++ b/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementInterface.sol @@ -12,14 +12,16 @@ * * SPDX-License-Identifier: Apache-2.0 */ -pragma solidity ^0.6.0; +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; + interface FlexiblePrivacyGroupManagementInterface { - function addParticipants(bytes32[] calldata publicEnclaveKeys) external returns (bool); + function addParticipants(bytes[] calldata publicEnclaveKeys) external returns (bool); - function removeParticipant(bytes32 participant) external returns (bool); + function removeParticipant(bytes calldata participant) external returns (bool); - function getParticipants() external view returns (bytes32[] memory); + function getParticipants() external view returns (bytes[] memory); function lock() external; diff --git a/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementProxy.sol b/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementProxy.sol index 28f47c973ff..b059b618966 100644 --- a/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementProxy.sol +++ b/privacy-contracts/src/main/solidity/FlexiblePrivacyGroupManagementProxy.sol @@ -12,14 +12,15 @@ * * SPDX-License-Identifier: Apache-2.0 */ -pragma solidity ^0.6.0; +pragma solidity >=0.7.0 <0.9.0; +pragma experimental ABIEncoderV2; import "./FlexiblePrivacyGroupManagementInterface.sol"; contract FlexiblePrivacyGroupManagementProxy is FlexiblePrivacyGroupManagementInterface { address public implementation; - constructor(address _implementation) public { + constructor(address _implementation) { implementation = _implementation; } @@ -27,23 +28,23 @@ contract FlexiblePrivacyGroupManagementProxy is FlexiblePrivacyGroupManagementIn implementation = _newImp; } - function addParticipants(bytes32[] memory _publicEnclaveKeys) public override returns (bool) { + function addParticipants(bytes[] calldata _publicEnclaveKeys) public override returns (bool) { FlexiblePrivacyGroupManagementInterface privacyInterface = FlexiblePrivacyGroupManagementInterface(implementation); return privacyInterface.addParticipants(_publicEnclaveKeys); } - function getParticipants() view public override returns (bytes32[] memory) { + function getParticipants() view public override returns (bytes[] memory) { FlexiblePrivacyGroupManagementInterface privacyInterface = FlexiblePrivacyGroupManagementInterface(implementation); return privacyInterface.getParticipants(); } - function removeParticipant(bytes32 _participant) public override returns (bool) { + function removeParticipant(bytes calldata _participant) public override returns (bool) { FlexiblePrivacyGroupManagementInterface privacyInterface = FlexiblePrivacyGroupManagementInterface(implementation); bool result = privacyInterface.removeParticipant(_participant); if (result) { emit ParticipantRemoved(_participant); } - return result; + return result; } function lock() public override { @@ -75,15 +76,14 @@ contract FlexiblePrivacyGroupManagementProxy is FlexiblePrivacyGroupManagementIn require(this.canExecute(), "The contract is locked."); require(implementation != _newImplementation, "The contract to upgrade to has to be different from the current management contract."); require(this.canUpgrade(), "Not allowed to upgrade the management contract."); - bytes32[] memory participants = this.getParticipants(); + bytes[] memory participants = this.getParticipants(); _setImplementation(_newImplementation); FlexiblePrivacyGroupManagementInterface privacyInterface = FlexiblePrivacyGroupManagementInterface(implementation); privacyInterface.addParticipants(participants); } event ParticipantRemoved( - bytes32 publicEnclaveKey + bytes publicEnclaveKey ); - } diff --git a/privacy-contracts/src/main/solidity/generateWrappers.sh b/privacy-contracts/src/main/solidity/generateWrappers.sh index a78f3781c24..068d7a1e3ac 100755 --- a/privacy-contracts/src/main/solidity/generateWrappers.sh +++ b/privacy-contracts/src/main/solidity/generateWrappers.sh @@ -16,7 +16,7 @@ done for target in ${targets}; do - web3j solidity generate \ + web3j generate solidity \ -b build/${target}.bin \ -a build/${target}.abi \ -o ../java \ diff --git a/testutil/src/main/java/org/hyperledger/enclave/testutil/EnclaveKeyConfiguration.java b/testutil/src/main/java/org/hyperledger/enclave/testutil/EnclaveKeyConfiguration.java index 929f2ac489e..846378995a6 100644 --- a/testutil/src/main/java/org/hyperledger/enclave/testutil/EnclaveKeyConfiguration.java +++ b/testutil/src/main/java/org/hyperledger/enclave/testutil/EnclaveKeyConfiguration.java @@ -33,10 +33,6 @@ public EnclaveKeyConfiguration( this.enclaveEncryptorType = enclaveEncryptorType; } - public EnclaveKeyConfiguration(final String[] pubKeyPaths, final String[] privKeyPaths) { - this(pubKeyPaths, privKeyPaths, EnclaveEncryptorType.NACL); - } - public String[] getPubKeyPaths() { return pubKeyPaths; }