Skip to content

Commit 65b712a

Browse files
committed
chore: removed contractCodeSize acceptance test to mitigate flakyness
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
1 parent 9fd4322 commit 65b712a

File tree

1 file changed

+1
-70
lines changed

1 file changed

+1
-70
lines changed

packages/server/tests/acceptance/rpc_batch1.spec.ts

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('@api-batch-1 RPC Server Acceptance Tests', function () {
9898
expectedGasPrice = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GAS_PRICE, [], requestIdPrefix);
9999

100100
const initialAccount: AliasAccount = global.accounts[0];
101-
const neededAccounts: number = 4;
101+
const neededAccounts: number = 3;
102102
accounts.push(
103103
...(await Utils.createMultipleAliasAccounts(
104104
mirrorNode,
@@ -1800,75 +1800,6 @@ describe('@api-batch-1 RPC Server Acceptance Tests', function () {
18001800
requestDetails,
18011801
]);
18021802
});
1803-
1804-
describe('contractCodeSize', function () {
1805-
it('@release should execute "eth_sendRawTransaction" and deploy a contract with code size within the limit', async function () {
1806-
const gasPrice = await relay.gasPrice(requestId);
1807-
const transaction = {
1808-
type: 2,
1809-
chainId: Number(CHAIN_ID),
1810-
nonce: await relay.getAccountNonce(accounts[3].address, requestId),
1811-
maxPriorityFeePerGas: gasPrice,
1812-
maxFeePerGas: gasPrice,
1813-
gasLimit: defaultGasLimit,
1814-
data: '0x' + '00'.repeat(Constants.CONTRACT_CODE_SIZE_LIMIT), // Within the CONTRACT_CODE_SIZE_LIMIT limit
1815-
};
1816-
1817-
const signedTx = await accounts[3].wallet.signTransaction(transaction);
1818-
const transactionHash = await relay.sendRawTransaction(signedTx, requestId);
1819-
const info = await mirrorNode.get(`/contracts/results/${transactionHash}`, requestId);
1820-
expect(info).to.have.property('contract_id');
1821-
expect(info.contract_id).to.not.be.null;
1822-
expect(info).to.have.property('created_contract_ids');
1823-
expect(info.created_contract_ids.length).to.be.equal(1);
1824-
});
1825-
1826-
it('@release should fail "eth_sendRawTransaction" for contract with code size exceeding the limit', async function () {
1827-
const gasPrice = await relay.gasPrice(requestId);
1828-
// Create a transaction with contract code size exceeding CONTRACT_CODE_SIZE_LIMIT
1829-
const transaction = {
1830-
type: 2,
1831-
chainId: Number(CHAIN_ID),
1832-
nonce: await relay.getAccountNonce(accounts[3].address, requestId),
1833-
maxPriorityFeePerGas: gasPrice,
1834-
maxFeePerGas: gasPrice,
1835-
gasLimit: defaultGasLimit,
1836-
data: '0x' + '00'.repeat(Constants.CONTRACT_CODE_SIZE_LIMIT + 1),
1837-
};
1838-
1839-
const signedTx = await accounts[3].wallet.signTransaction(transaction);
1840-
const contractCodeSize = (transaction.data.length - 2) / 2;
1841-
const error = predefined.CONTRACT_CODE_SIZE_LIMIT_EXCEEDED(
1842-
contractCodeSize,
1843-
Constants.CONTRACT_CODE_SIZE_LIMIT,
1844-
);
1845-
1846-
await Assertions.assertPredefinedRpcError(error, sendRawTransaction, false, relay, [
1847-
signedTx,
1848-
requestDetails,
1849-
]);
1850-
});
1851-
1852-
it('@release should pass precheck and execute "eth_sendRawTransaction" for a regular transaction i.e. non contract deployment transaction with data exceeding the limit', async function () {
1853-
const gasPrice = await relay.gasPrice(requestId);
1854-
// Create a transaction with large data but sent to an existing address (not contract creation)
1855-
const transaction = {
1856-
type: 2,
1857-
chainId: Number(CHAIN_ID),
1858-
nonce: await relay.getAccountNonce(accounts[3].address, requestId),
1859-
maxPriorityFeePerGas: gasPrice,
1860-
maxFeePerGas: gasPrice,
1861-
gasLimit: defaultGasLimit,
1862-
to: parentContractAddress, // Sending to existing address, so code size check doesn't apply
1863-
data: '0x' + '00'.repeat(Constants.CONTRACT_CODE_SIZE_LIMIT + 1), // Size exceeds CONTRACT_CODE_SIZE_LIMIT but should work
1864-
};
1865-
1866-
const signedTx = await accounts[3].wallet.signTransaction(transaction);
1867-
const transactionHash = await relay.sendRawTransaction(signedTx, requestId);
1868-
const info = await mirrorNode.get(`/contracts/results/${transactionHash}`, requestId);
1869-
expect(info).to.exist;
1870-
});
1871-
});
18721803
});
18731804

18741805
it('@release should execute "eth_getTransactionByHash" for existing transaction', async function () {

0 commit comments

Comments
 (0)