Skip to content

Commit

Permalink
chore: reduce EthereumTransaction relayer fees (#15577)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinker-michaelj authored Sep 23, 2024
1 parent 8dfd416 commit d5acc8e
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 179 deletions.
66 changes: 32 additions & 34 deletions hedera-node/configuration/mainnet/upgrade/feeSchedules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2917,28 +2917,27 @@
"hederaFunctionality": "EthereumTransaction",
"fees": [
{
"subType": "DEFAULT",
"nodedata": {
"constant": 3336515210,
"bpt": 5334088,
"vpt": 13335219927,
"rbh": 3556,
"sbh": 267,
"gas": 0,
"bpr": 5334088,
"sbpr": 133352,
"constant": 6122046,
"bpt": 9787,
"vpt": 24468293,
"rbh": 6,
"sbh": 0,
"gas": 65,
"bpr": 9787,
"sbpr": 244,
"min": 0,
"max": 1000000000000000
},
"networkdata": {
"constant": 53384243355,
"bpt": 85345408,
"vpt": 213363518838,
"rbh": 56897,
"sbh": 4267,
"gas": 0,
"bpr": 85345408,
"sbpr": 2133635,
"constant": 97952740,
"bpt": 156597,
"vpt": 391492695,
"rbh": 104,
"sbh": 7,
"gas": 1043,
"bpr": 156597,
"sbpr": 3914,
"min": 0,
"max": 1000000000000000
},
Expand Down Expand Up @@ -6663,28 +6662,27 @@
"hederaFunctionality": "EthereumTransaction",
"fees": [
{
"subType": "DEFAULT",
"nodedata": {
"constant": 3336515210,
"bpt": 5334088,
"vpt": 13335219927,
"rbh": 3556,
"sbh": 267,
"gas": 0,
"bpr": 5334088,
"sbpr": 133352,
"constant": 6122046,
"bpt": 9787,
"vpt": 24468293,
"rbh": 6,
"sbh": 0,
"gas": 65,
"bpr": 9787,
"sbpr": 244,
"min": 0,
"max": 1000000000000000
},
"networkdata": {
"constant": 53384243355,
"bpt": 85345408,
"vpt": 213363518838,
"rbh": 56897,
"sbh": 4267,
"gas": 0,
"bpr": 85345408,
"sbpr": 2133635,
"constant": 97952740,
"bpt": 156597,
"vpt": 391492695,
"rbh": 104,
"sbh": 7,
"gas": 1043,
"bpr": 156597,
"sbpr": 3914,
"min": 0,
"max": 1000000000000000
},
Expand Down
154 changes: 78 additions & 76 deletions hedera-node/configuration/testnet/upgrade/feeSchedules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2769,45 +2769,46 @@
}, {
"transactionFeeSchedule" : {
"hederaFunctionality" : "EthereumTransaction",
"fees" : [ {
"subType" : "DEFAULT",
"nodedata" : {
"constant" : 3336515210,
"bpt" : 5334088,
"vpt" : 13335219927,
"rbh" : 3556,
"sbh" : 267,
"gas" : 0,
"bpr" : 5334088,
"sbpr" : 133352,
"min" : 0,
"max" : 1000000000000000
},
"networkdata" : {
"constant" : 53384243355,
"bpt" : 85345408,
"vpt" : 213363518838,
"rbh" : 56897,
"sbh" : 4267,
"gas" : 0,
"bpr" : 85345408,
"sbpr" : 2133635,
"min" : 0,
"max" : 1000000000000000
},
"servicedata" : {
"constant" : 0,
"bpt" : 0,
"vpt" : 0,
"rbh" : 0,
"sbh" : 0,
"gas" : 852000,
"bpr" : 0,
"sbpr" : 0,
"min" : 0,
"max" : 1000000000000000
"fees": [
{
"nodedata": {
"constant": 6122046,
"bpt": 9787,
"vpt": 24468293,
"rbh": 6,
"sbh": 0,
"gas": 65,
"bpr": 9787,
"sbpr": 244,
"min": 0,
"max": 1000000000000000
},
"networkdata": {
"constant": 97952740,
"bpt": 156597,
"vpt": 391492695,
"rbh": 104,
"sbh": 7,
"gas": 1043,
"bpr": 156597,
"sbpr": 3914,
"min": 0,
"max": 1000000000000000
},
"servicedata": {
"constant": 0,
"bpt": 0,
"vpt": 0,
"rbh": 0,
"sbh": 0,
"gas": 852000,
"bpr": 0,
"sbpr": 0,
"min": 0,
"max": 1000000000000000
}
}
} ]
]
}
}, {
"transactionFeeSchedule" : {
Expand Down Expand Up @@ -6310,45 +6311,46 @@
}, {
"transactionFeeSchedule" : {
"hederaFunctionality" : "EthereumTransaction",
"fees" : [ {
"subType" : "DEFAULT",
"nodedata" : {
"constant" : 3336515210,
"bpt" : 5334088,
"vpt" : 13335219927,
"rbh" : 3556,
"sbh" : 267,
"gas" : 0,
"bpr" : 5334088,
"sbpr" : 133352,
"min" : 0,
"max" : 1000000000000000
},
"networkdata" : {
"constant" : 53384243355,
"bpt" : 85345408,
"vpt" : 213363518838,
"rbh" : 56897,
"sbh" : 4267,
"gas" : 0,
"bpr" : 85345408,
"sbpr" : 2133635,
"min" : 0,
"max" : 1000000000000000
},
"servicedata" : {
"constant" : 0,
"bpt" : 0,
"vpt" : 0,
"rbh" : 0,
"sbh" : 0,
"gas" : 852000,
"bpr" : 0,
"sbpr" : 0,
"min" : 0,
"max" : 1000000000000000
"fees": [
{
"nodedata": {
"constant": 6122046,
"bpt": 9787,
"vpt": 24468293,
"rbh": 6,
"sbh": 0,
"gas": 65,
"bpr": 9787,
"sbpr": 244,
"min": 0,
"max": 1000000000000000
},
"networkdata": {
"constant": 97952740,
"bpt": 156597,
"vpt": 391492695,
"rbh": 104,
"sbh": 7,
"gas": 1043,
"bpr": 156597,
"sbpr": 3914,
"min": 0,
"max": 1000000000000000
},
"servicedata": {
"constant": 0,
"bpt": 0,
"vpt": 0,
"rbh": 0,
"sbh": 0,
"gas": 852000,
"bpr": 0,
"sbpr": 0,
"min": 0,
"max": 1000000000000000
}
}
} ]
]
}
}, {
"transactionFeeSchedule" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2871,28 +2871,27 @@
"hederaFunctionality": "EthereumTransaction",
"fees": [
{
"subType": "DEFAULT",
"nodedata": {
"constant": 3336515210,
"bpt": 5334088,
"vpt": 13335219927,
"rbh": 3556,
"sbh": 267,
"gas": 0,
"bpr": 5334088,
"sbpr": 133352,
"constant": 6122046,
"bpt": 9787,
"vpt": 24468293,
"rbh": 6,
"sbh": 0,
"gas": 65,
"bpr": 9787,
"sbpr": 244,
"min": 0,
"max": 1000000000000000
},
"networkdata": {
"constant": 53384243355,
"bpt": 85345408,
"vpt": 213363518838,
"rbh": 56897,
"sbh": 4267,
"gas": 0,
"bpr": 85345408,
"sbpr": 2133635,
"constant": 97952740,
"bpt": 156597,
"vpt": 391492695,
"rbh": 104,
"sbh": 7,
"gas": 1043,
"bpr": 156597,
"sbpr": 3914,
"min": 0,
"max": 1000000000000000
},
Expand Down Expand Up @@ -6617,28 +6616,27 @@
"hederaFunctionality": "EthereumTransaction",
"fees": [
{
"subType": "DEFAULT",
"nodedata": {
"constant": 3336515210,
"bpt": 5334088,
"vpt": 13335219927,
"rbh": 3556,
"sbh": 267,
"gas": 0,
"bpr": 5334088,
"sbpr": 133352,
"constant": 6122046,
"bpt": 9787,
"vpt": 24468293,
"rbh": 6,
"sbh": 0,
"gas": 65,
"bpr": 9787,
"sbpr": 244,
"min": 0,
"max": 1000000000000000
},
"networkdata": {
"constant": 53384243355,
"bpt": 85345408,
"vpt": 213363518838,
"rbh": 56897,
"sbh": 4267,
"gas": 0,
"bpr": 85345408,
"sbpr": 2133635,
"constant": 97952740,
"bpt": 156597,
"vpt": 391492695,
"rbh": 104,
"sbh": 7,
"gas": 1043,
"bpr": 156597,
"sbpr": 3914,
"min": 0,
"max": 1000000000000000
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import static com.hedera.services.bdd.spec.assertions.TransferListAsserts.includingDeduction;
import static com.hedera.services.bdd.spec.keys.KeyFactory.KeyType.THRESHOLD;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountInfo;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getAliasedAccountInfo;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getAutoCreatedAccountBalance;
import static com.hedera.services.bdd.spec.queries.QueryVerbs.getContractBytecode;
Expand Down Expand Up @@ -83,9 +84,11 @@
import static com.hedera.services.bdd.suites.contract.Utils.eventSignatureOf;
import static com.hedera.services.bdd.suites.contract.Utils.getABIFor;
import static com.hedera.services.bdd.suites.contract.Utils.getResourcePath;
import static com.hedera.services.bdd.suites.contract.hapi.ContractCallSuite.DEPOSIT;
import static com.hedera.services.bdd.suites.contract.precompile.CreatePrecompileSuite.TOKEN_NAME;
import static com.hedera.services.bdd.suites.crypto.AutoCreateUtils.updateSpecFor;
import static com.hedera.services.bdd.suites.crypto.CryptoCreateSuite.ACCOUNT;
import static com.hedera.services.bdd.suites.ethereum.HelloWorldEthereumSuite.depositAmount;
import static com.hedera.services.bdd.suites.leaky.LeakyContractTestsSuite.RECEIVER;
import static com.hedera.services.bdd.suites.token.TokenAssociationSpecs.MULTI_KEY;
import static com.hedera.services.bdd.suites.token.TokenAssociationSpecs.VANILLA_TOKEN;
Expand Down Expand Up @@ -201,6 +204,29 @@ final Stream<DynamicTest> sendingLargerBalanceThanAvailableFailsGracefully() {
.hasPriority(recordWith().transfers(includingDeduction("HAPI fees", RELAYER))));
}

@HapiTest
final Stream<DynamicTest> baseRelayerCostAsExpected() {
return hapiTest(
newKeyNamed(SECP_256K1_SOURCE_KEY).shape(SECP_256K1_SHAPE),
cryptoCreate(RELAYER).balance(ONE_HUNDRED_HBARS),
cryptoTransfer(tinyBarsFromAccountToAlias(GENESIS, SECP_256K1_SOURCE_KEY, ONE_HUNDRED_HBARS)),
uploadInitCode(PAY_RECEIVABLE_CONTRACT),
contractCreate(PAY_RECEIVABLE_CONTRACT).adminKey(THRESHOLD),
ethereumCall(PAY_RECEIVABLE_CONTRACT, DEPOSIT, BigInteger.valueOf(depositAmount))
.type(EthTxData.EthTransactionType.EIP1559)
.signingWith(SECP_256K1_SOURCE_KEY)
.payingWith(RELAYER)
.nonce(0)
.gasPrice(100L)
.maxFeePerGas(100L)
.maxPriorityGas(2_000_000L)
.gasLimit(1_000_000L)
.sending(depositAmount),
// The relayer's cost to transmit a simple call with sufficient gas allowance is ≈ $0.0001
getAccountInfo(RELAYER)
.has(accountWith().expectedBalanceWithChargedUsd(ONE_HUNDRED_HBARS, 0.0001, 0.5)));
}

@HapiTest
final Stream<DynamicTest> etx010TransferToCryptoAccountSucceeds() {
String RECEIVER = "RECEIVER";
Expand Down
Loading

0 comments on commit d5acc8e

Please sign in to comment.