Skip to content

Commit

Permalink
Merge branch 'develop' into 08717-fix-recSigReq-delegate-detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tinker-michaelj committed Nov 10, 2023
2 parents 679d689 + af2f38e commit 42e8314
Show file tree
Hide file tree
Showing 48 changed files with 1,147 additions and 182 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/node-flow-fsts-daily-interval-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ concurrency:
group: ${{ github.event.inputs.concurrency-group || format('{0}-{1}-flow-jrs-daily-interval-groups', github.ref_name, github.sha) }}

# Panel Definition & Timings:
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Ubuntu1804-4N-2C.json" ---- 120m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Rhel7-4N-2C.json" ---- 120m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Rhel8-4N-2C.json" ---- 120m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-CentOS7-4N-2C.json" ---- 120m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-4N-2C.json" ---- 120m
# TOTAL RUN TIME: 600 minutes, 10 hours
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Ubuntu1804-4N-2C.json" ---- 90m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Rhel7-4N-2C.json" ---- 90m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Rhel8-4N-2C.json" ---- 90m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-CentOS7-4N-2C.json" ---- 90m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-4N-2C.json" ---- 90m
# "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Ubuntu2204-4N-2C.json" ---- 90m
# TOTAL RUN TIME: 540 minutes, 9 hours

jobs:
crypto-update-ubuntu1804-4n-2c:
Expand Down Expand Up @@ -150,3 +151,21 @@ jobs:
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
if: ${{ !cancelled() && always() }}

crypto-update-ubuntu2204-4n-2c:
name: Crypto-Update-Ubuntu2204-4N-2C
uses: ./.github/workflows/zxc-jrs-regression.yaml
with:
ref: ${{ github.event.inputs.ref }}
branch-name: ${{ github.event.inputs.branch-name }}
hedera-tests-enabled: true
use-branch-for-slack-channel: true
panel-config: "configs/services/suites/daily/GCP-Daily-Services-Crypto-Update-Ubuntu2204-4N-2C.json"
secrets:
access-token: ${{ secrets.PLATFORM_GH_ACCESS_TOKEN }}
jrs-ssh-user-name: ${{ secrets.PLATFORM_JRS_SSH_USER_NAME }}
jrs-ssh-key-file: ${{ secrets.PLATFORM_JRS_SSH_KEY_FILE }}
gcp-project-number: ${{ secrets.PLATFORM_GCP_PROJECT_NUMBER }}
gcp-sa-key-contents: ${{ secrets.PLATFORM_GCP_KEY_FILE }}
slack-api-token: ${{ secrets.PLATFORM_SLACK_API_TOKEN }}
if: ${{ !cancelled() && always() }}
24 changes: 24 additions & 0 deletions hedera-node/hedera-app/src/xtest/java/common/AbstractXTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,30 @@ protected Bytes resourceAsBytes(@NonNull final String loc) {
}
}

protected void addUsableRelation(
@NonNull final Map<EntityIDPair, TokenRelation> tokenRels,
@NonNull final AccountID accountID,
@NonNull final TokenID tokenID,
@NonNull final Consumer<TokenRelation.Builder> spec) {
final var rel =
TokenRelation.newBuilder().accountId(accountID).tokenId(tokenID).kycGranted(true);
spec.accept(rel);
tokenRels.put(
EntityIDPair.newBuilder().tokenId(tokenID).accountId(accountID).build(), rel.build());
}

protected void addNft(
@NonNull final Map<NftID, Nft> nfts,
@NonNull final TokenID tokenID,
final long serialNo,
@NonNull final Consumer<Nft.Builder> spec) {
final var nftId =
NftID.newBuilder().tokenId(tokenID).serialNumber(serialNo).build();
final var nftBuilder = Nft.newBuilder().metadata(Bytes.wrap("0.0." + tokenID.tokenNum() + "." + serialNo));
spec.accept(nftBuilder);
nfts.put(nftId, nftBuilder.build());
}

protected void assertExpectedStorage(
@NonNull ReadableKVState<SlotKey, SlotValue> storage,
@NonNull ReadableKVState<AccountID, Account> accounts) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package contract;

import static com.hedera.node.app.service.contract.impl.ContractServiceImpl.CONTRACT_SERVICE;
import static com.hedera.node.app.service.contract.impl.exec.utils.FrameUtils.CONFIG_CONTEXT_VARIABLE;
import static com.hedera.node.app.service.contract.impl.exec.utils.FrameUtils.SYSTEM_CONTRACT_GAS_GAS_CALCULATOR_VARIABLE;
import static com.hedera.node.app.service.contract.impl.utils.ConversionUtils.asLongZeroAddress;
Expand Down Expand Up @@ -50,6 +51,8 @@
import com.hedera.node.app.service.contract.impl.exec.systemcontracts.hts.HtsCallAttempt;
import com.hedera.node.app.service.contract.impl.exec.systemcontracts.hts.HtsCallFactory;
import com.hedera.node.app.service.contract.impl.exec.systemcontracts.hts.SyntheticIds;
import com.hedera.node.app.service.contract.impl.handlers.ContractCallHandler;
import com.hedera.node.app.service.contract.impl.handlers.ContractCreateHandler;
import com.hedera.node.app.service.contract.impl.hevm.HederaWorldUpdater;
import com.hedera.node.app.service.contract.impl.state.ProxyWorldUpdater;
import com.hedera.node.app.spi.workflows.TransactionHandler;
Expand Down Expand Up @@ -82,8 +85,8 @@
public abstract class AbstractContractXTest extends AbstractXTest {
private static final SyntheticIds LIVE_SYNTHETIC_IDS = new SyntheticIds();
private static final VerificationStrategies LIVE_VERIFICATION_STRATEGIES = new VerificationStrategies();
static final long GAS_TO_OFFER = 2_000_000L;
static final Duration STANDARD_AUTO_RENEW_PERIOD = new Duration(7776000L);
protected static final long GAS_TO_OFFER = 2_000_000L;
protected static final Duration STANDARD_AUTO_RENEW_PERIOD = new Duration(7776000L);

@Mock
private MessageFrame frame;
Expand All @@ -99,7 +102,7 @@ public abstract class AbstractContractXTest extends AbstractXTest {

private HtsCallFactory callAttemptFactory;

private ContractScaffoldingComponent component;
protected ContractScaffoldingComponent component;

@BeforeEach
void setUp() {
Expand Down Expand Up @@ -182,6 +185,14 @@ protected void runHtsCallAndExpectRevert(
internalRunHtsCallAndExpectRevert(sender, input, status, null);
}

protected ContractCreateHandler createHandler() {
return CONTRACT_SERVICE.handlers().contractCreateHandler();
}

protected ContractCallHandler callHandler() {
return CONTRACT_SERVICE.handlers().contractCallHandler();
}

protected void runHtsCallAndExpectRevert(
@NonNull final org.hyperledger.besu.datatypes.Address sender,
@NonNull final org.apache.tuweni.bytes.Bytes input,
Expand Down Expand Up @@ -255,7 +266,7 @@ private void runHtsCallAndExpect(

final var call = callAttemptFactory.createCallFrom(input, frame);

final var pricedResult = call.execute();
final var pricedResult = call.execute(frame);
resultAssertions.accept(pricedResult);
// Note that committing a reverted calls should have no effect on state
((SavepointStackImpl) context.savepointStack()).commitFullStack();
Expand Down Expand Up @@ -313,6 +324,14 @@ private Consumer<HtsCall.PricedResult> resultOnlyAssertion(
};
}

public static com.esaulpaugh.headlong.abi.Address asLongZeroHeadlongAddress(final AccountID accountID) {
return Address.wrap(Address.toChecksumAddress(BigInteger.valueOf(accountID.accountNumOrThrow())));
}

public static com.esaulpaugh.headlong.abi.Address asLongZeroHeadlongAddress(final TokenID tokenID) {
return Address.wrap(Address.toChecksumAddress(BigInteger.valueOf(tokenID.tokenNum())));
}

public static com.esaulpaugh.headlong.abi.Address asHeadlongAddress(final byte[] address) {
final var addressBytes = org.apache.tuweni.bytes.Bytes.wrap(address);
final var addressAsInteger = addressBytes.toUnsignedBigInteger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
import static contract.AssortedOpsXTestConstants.FINALIZED_AND_DESTRUCTED_CONTRACT_ID;
import static contract.AssortedOpsXTestConstants.FINALIZED_AND_DESTRUCTED_ID;
import static contract.AssortedOpsXTestConstants.NEXT_ENTITY_NUM;
import static contract.AssortedOpsXTestConstants.ONE_HBAR;
import static contract.AssortedOpsXTestConstants.POINTLESS_INTERMEDIARY_ADDRESS;
import static contract.AssortedOpsXTestConstants.POINTLESS_INTERMEDIARY_ID;
import static contract.AssortedOpsXTestConstants.RELAYER_ID;
import static contract.AssortedOpsXTestConstants.RUBE_GOLDBERG_CHILD_ID;
import static contract.AssortedOpsXTestConstants.SALT;
import static contract.AssortedOpsXTestConstants.SENDER_ALIAS;
import static contract.AssortedOpsXTestConstants.TAKE_FIVE;
import static contract.AssortedOpsXTestConstants.VACATE_ADDRESS;
import static contract.XTestConstants.MISC_PAYER_ID;
import static contract.XTestConstants.ONE_HBAR;
import static contract.XTestConstants.SENDER_ADDRESS;
import static contract.XTestConstants.SENDER_ALIAS;
import static contract.XTestConstants.SENDER_ID;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@
*/
public class AssortedOpsXTestConstants {
static final long NEXT_ENTITY_NUM = 1004L;
static final long ONE_HBAR = 100_000_000L;
static final long EXPECTED_ASSORTED_OPS_NONCE = 4;
static final long EXPECTED_ASSORTED_OPS_BALANCE = 2 * ONE_HBAR - 5;
static final Bytes SENDER_ALIAS =
Bytes.fromHex("3a21030edcc130e13fb5102e7c883535af8c2b0a5a617231f77fd127ce5f3b9a620591");
static final long EXPECTED_ASSORTED_OPS_BALANCE = 2 * XTestConstants.ONE_HBAR - 5;
static final Bytes POINTLESS_INTERMEDIARY_ADDRESS = Bytes.fromHex("f9f3aa959ec3a248f8ff8ea1602e6714ae9cc4e3");
static final Bytes DETERMINISTIC_CHILD_ADDRESS = Bytes.fromHex("fee687d5088faff48013a6767505c027e2742536");
static final AccountID COINBASE_ID = AccountID.newBuilder().accountNum(98L).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import static contract.XTestConstants.SN_1234_METADATA;
import static contract.XTestConstants.SN_2345;
import static contract.XTestConstants.addErc20Relation;
import static contract.XTestConstants.addErc721Relation;
import static contract.XTestConstants.assertSuccess;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -242,7 +243,7 @@ protected Map<NftID, Nft> initialNfts() {
protected Map<EntityIDPair, TokenRelation> initialTokenRelationships() {
final var tokenRelationships = new HashMap<EntityIDPair, TokenRelation>();
addErc20Relation(tokenRelationships, OWNER_ID, TOKEN_BALANCE);
XTestConstants.addErc721Relation(tokenRelationships, UNAUTHORIZED_SPENDER_ID, TOKEN_BALANCE);
addErc721Relation(tokenRelationships, UNAUTHORIZED_SPENDER_ID, TOKEN_BALANCE);
return tokenRelationships;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package contract;

import static com.hedera.node.app.service.contract.impl.ContractServiceImpl.CONTRACT_SERVICE;
import static contract.AssortedOpsXTestConstants.ONE_HBAR;
import static contract.ClassicViewsXTestConstants.ADMIN_KEY;
import static contract.ClassicViewsXTestConstants.AUTORENEW_SECONDS;
import static contract.ClassicViewsXTestConstants.CLASSIC_QUERIES_X_TEST_ID;
Expand Down Expand Up @@ -65,6 +64,7 @@
import static contract.XTestConstants.ERC20_TOKEN_ID;
import static contract.XTestConstants.ERC721_TOKEN_ADDRESS;
import static contract.XTestConstants.ERC721_TOKEN_ID;
import static contract.XTestConstants.ONE_HBAR;

import com.esaulpaugh.headlong.abi.Function;
import com.esaulpaugh.headlong.abi.TupleType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import static com.hedera.hapi.node.base.ResponseCodeEnum.MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED;
import static com.hedera.node.app.service.contract.impl.ContractServiceImpl.CONTRACT_SERVICE;
import static contract.AssortedOpsXTestConstants.ONE_HBAR;
import static contract.AssortedOpsXTestConstants.SENDER_ALIAS;
import static contract.Erc721XTestConstants.COINBASE_ID;
import static contract.XTestConstants.COINBASE_ID;
import static contract.XTestConstants.ONE_HBAR;
import static contract.XTestConstants.SENDER_ADDRESS;
import static contract.XTestConstants.SENDER_ALIAS;
import static contract.XTestConstants.SENDER_ID;

import com.hedera.hapi.node.base.AccountID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package contract;

import static com.hedera.node.app.service.contract.impl.ContractServiceImpl.CONTRACT_SERVICE;
import static contract.Erc721XTestConstants.COINBASE_ID;
import static contract.Erc721XTestConstants.COUNTERPARTY_ADDRESS;
import static contract.Erc721XTestConstants.COUNTERPARTY_ID;
import static contract.Erc721XTestConstants.ERC721_FULL_ID;
Expand All @@ -31,6 +30,7 @@
import static contract.Erc721XTestConstants.PARTY_ID;
import static contract.Erc721XTestConstants.TOKEN_TREASURY_ADDRESS;
import static contract.Erc721XTestConstants.TOKEN_TREASURY_ID;
import static contract.XTestConstants.COINBASE_ID;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class Erc721XTestConstants {
Map.entry(
Bytes.fromHex("86B3FA87EE245373978E0D2D334DBDE866C9B8B039036B87C5EB2FD89BCB6BAB"),
Bytes.fromHex("000000000000000000000000d893f18b69a06f7ffffad77202c2f627cb2c9605")));
static final AccountID COINBASE_ID = AccountID.newBuilder().accountNum(98L).build();
static final AccountID TOKEN_TREASURY_ID =
AccountID.newBuilder().accountNum(1001L).build();
static final AccountID COUNTERPARTY_ID =
Expand Down
6 changes: 3 additions & 3 deletions hedera-node/hedera-app/src/xtest/java/contract/FuseXTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
package contract;

import static com.hedera.node.app.service.contract.impl.ContractServiceImpl.CONTRACT_SERVICE;
import static contract.AssortedOpsXTestConstants.ONE_HBAR;
import static contract.AssortedOpsXTestConstants.SENDER_ALIAS;
import static contract.Erc721XTestConstants.COINBASE_ID;
import static contract.XTestConstants.COINBASE_ID;
import static contract.XTestConstants.ONE_HBAR;
import static contract.XTestConstants.SENDER_ADDRESS;
import static contract.XTestConstants.SENDER_ALIAS;
import static contract.XTestConstants.SENDER_ID;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package contract;

import static com.hedera.node.app.service.contract.impl.ContractServiceImpl.CONTRACT_SERVICE;
import static contract.AssortedOpsXTestConstants.ONE_HBAR;
import static contract.MiscViewsXTestConstants.COINBASE_ID;
import static contract.MiscViewsXTestConstants.EQUIV_TINYCENTS;
import static contract.MiscViewsXTestConstants.ERC20_DECIMALS;
Expand Down Expand Up @@ -61,6 +60,7 @@
import static contract.XTestConstants.ERC20_TOKEN_ID;
import static contract.XTestConstants.ERC721_TOKEN_ADDRESS;
import static contract.XTestConstants.ERC721_TOKEN_ID;
import static contract.XTestConstants.ONE_HBAR;

import com.esaulpaugh.headlong.abi.Function;
import com.esaulpaugh.headlong.abi.TupleType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import static com.hedera.node.app.service.contract.impl.ContractServiceImpl.CONTRACT_SERVICE;
import static contract.AssortedOpsXTestConstants.COINBASE_ID;
import static contract.AssortedOpsXTestConstants.ONE_HBAR;
import static contract.XTestConstants.AN_ED25519_KEY;
import static contract.XTestConstants.ERC20_TOKEN_ADDRESS;
import static contract.XTestConstants.ERC20_TOKEN_ID;
import static contract.XTestConstants.ONE_HBAR;
import static contract.XTestConstants.SENDER_ADDRESS;
import static contract.XTestConstants.SENDER_HEADLONG_ADDRESS;
import static contract.XTestConstants.SENDER_ID;
Expand Down

0 comments on commit 42e8314

Please sign in to comment.