Skip to content

Commit

Permalink
chore: made chainConfig files match testnet configuration (#3020)
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf committed Aug 27, 2024
1 parent fcfbdf1 commit 986a247
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 145 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-beans-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/utils": patch
---

chore: made `chainConfig` files match testnet configuration
116 changes: 58 additions & 58 deletions .fuel-core/configs/chainConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"max_inputs": 255,
"max_outputs": 255,
"max_witnesses": 255,
"max_gas_per_tx": 100000000,
"max_gas_per_tx": 30000000,
"max_size": 262144,
"max_bytecode_subsections": 256
}
Expand All @@ -17,7 +17,7 @@
"max_predicate_length": 102400,
"max_predicate_data_length": 102400,
"max_message_data_length": 102400,
"max_gas_per_predicate": 100000000
"max_gas_per_predicate": 30000000
}
},
"script_params": {
Expand All @@ -34,7 +34,7 @@
},
"fee_params": {
"V1": {
"gas_price_factor": 92,
"gas_price_factor": 92000,
"gas_per_byte": 63
}
},
Expand Down Expand Up @@ -79,8 +79,9 @@
"lw": 2,
"mint": 18042,
"mlog": 2,
"mod": 2,
"modi": 2,
"mod_op": 2,
"move": 2,
"movi": 2,
"mroo": 4,
"mul": 2,
Expand All @@ -94,8 +95,8 @@
"popl": 3,
"pshh": 5,
"pshl": 5,
"move_op": 2,
"ret": 53,
"ret_contract": 53,
"rvrt_contract": 52,
"sb": 2,
"sll": 2,
"slli": 2,
Expand Down Expand Up @@ -125,11 +126,10 @@
"wqmm": 8,
"xor": 2,
"xori": 2,
"rvrt": 2,
"aloc": {
"HeavyOperation": {
"LightOperation": {
"base": 2,
"gas_per_unit": 0
"units_per_gas": 15
}
},
"bsiz": {
Expand All @@ -145,154 +145,154 @@
}
},
"cfe": {
"HeavyOperation": {
"base": 2,
"gas_per_unit": 0
"LightOperation": {
"base": 10,
"units_per_gas": 1818181
}
},
"cfei": {
"HeavyOperation": {
"LightOperation": {
"base": 2,
"gas_per_unit": 0
"units_per_gas": 1000000
}
},
"call": {
"LightOperation": {
"base": 18190,
"units_per_gas": 5
"base": 13513,
"units_per_gas": 7
}
},
"ccp": {
"LightOperation": {
"base": 48,
"units_per_gas": 22
"base": 34,
"units_per_gas": 39
}
},
"croo": {
"LightOperation": {
"base": 131,
"units_per_gas": 2
"base": 91,
"units_per_gas": 3
}
},
"csiz": {
"LightOperation": {
"base": 45,
"units_per_gas": 237
"base": 31,
"units_per_gas": 438
}
},
"ed19": {
"LightOperation": {
"base": 45,
"units_per_gas": 237
"base": 3000,
"units_per_gas": 214
}
},
"k256": {
"LightOperation": {
"base": 37,
"units_per_gas": 3
"base": 27,
"units_per_gas": 5
}
},
"ldc": {
"LightOperation": {
"base": 39,
"units_per_gas": 68
"base": 43,
"units_per_gas": 102
}
},
"logd": {
"LightOperation": {
"base": 565,
"units_per_gas": 2
"base": 363,
"units_per_gas": 4
}
},
"mcl": {
"LightOperation": {
"base": 3,
"units_per_gas": 564
"base": 2,
"units_per_gas": 1041
}
},
"mcli": {
"LightOperation": {
"base": 3,
"units_per_gas": 560
"base": 2,
"units_per_gas": 1025
}
},
"mcp": {
"LightOperation": {
"base": 4,
"units_per_gas": 185
"units_per_gas": 325
}
},
"mcpi": {
"LightOperation": {
"base": 9,
"units_per_gas": 455
"base": 8,
"units_per_gas": 511
}
},
"meq": {
"LightOperation": {
"base": 3,
"units_per_gas": 766
"units_per_gas": 940
}
},
"retd": {
"retd_contract": {
"LightOperation": {
"base": 485,
"units_per_gas": 3
"base": 305,
"units_per_gas": 4
}
},
"s256": {
"LightOperation": {
"base": 42,
"units_per_gas": 3
"base": 31,
"units_per_gas": 4
}
},
"scwq": {
"HeavyOperation": {
"base": 21672,
"gas_per_unit": 22146
"base": 16346,
"gas_per_unit": 17163
}
},
"smo": {
"LightOperation": {
"base": 44437,
"units_per_gas": 1
"base": 40860,
"units_per_gas": 2
}
},
"srwq": {
"HeavyOperation": {
"base": 239,
"gas_per_unit": 234
"base": 187,
"gas_per_unit": 179
}
},
"swwq": {
"HeavyOperation": {
"base": 22724,
"gas_per_unit": 21231
"base": 17046,
"gas_per_unit": 16232
}
},
"contract_root": {
"LightOperation": {
"base": 42,
"base": 31,
"units_per_gas": 2
}
},
"state_root": {
"HeavyOperation": {
"base": 323,
"gas_per_unit": 169
"base": 236,
"gas_per_unit": 122
}
},
"new_storage_per_byte": 63,
"vm_initialization": {
"HeavyOperation": {
"base": 5254820,
"gas_per_unit": 0
"LightOperation": {
"base": 3957,
"units_per_gas": 48
}
}
}
},
"base_asset_id": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
"block_gas_limit": 100000000,
"block_gas_limit": 30000000,
"privileged_address": "0000000000000000000000000000000000000000000000000000000000000000"
}
},
Expand Down
6 changes: 4 additions & 2 deletions packages/account/src/providers/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('Provider', () => {
{
type: ReceiptType.ScriptResult,
result: bn(0),
gasUsed: bn(107),
gasUsed: bn(159),
},
];

Expand Down Expand Up @@ -407,7 +407,7 @@ describe('Provider', () => {
});

it('should cache resources only when TX is successfully submitted', async () => {
const resourceAmount = 50_000;
const resourceAmount = 5_000;
const utxosAmount = 2;

const testMessage = new TestMessage({ amount: resourceAmount });
Expand All @@ -416,6 +416,7 @@ describe('Provider', () => {
nodeOptions: {
args: ['--poa-instant', 'false', '--poa-interval-period', '1s'],
},
// 3 resources with a total of 15_000
walletsConfig: {
coinsPerAsset: utxosAmount,
amountPerCoin: resourceAmount,
Expand All @@ -432,6 +433,7 @@ describe('Provider', () => {

expect(coins.length).toBe(utxosAmount);

// Tx will cost 10_000 for the transfer + 1 for fee. All resources will be used
const EXPECTED = {
utxos: coins.map((coin) => coin.id),
messages: [testMessage.nonce],
Expand Down
6 changes: 3 additions & 3 deletions packages/fuel-gauge/src/funding-transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('Funding Transactions', () => {
wallets: [funded],
} = launched;

const splitIn = 20;
const splitIn = 204;
const sender = Wallet.generate({ provider });
const receiver = Wallet.generate({ provider });

Expand All @@ -233,7 +233,7 @@ describe('Funding Transactions', () => {
*/
await fundingTxWithMultipleUTXOs({
account: sender,
totalAmount: 2400,
totalAmount: 1020,
splitIn,
baseAssetId: provider.getBaseAssetId(),
mainWallet: funded,
Expand Down Expand Up @@ -271,7 +271,7 @@ describe('Funding Transactions', () => {
new FuelError(FuelError.CODES.INVALID_REQUEST, 'not enough coins to fit the target')
);

expect(getResourcesToSpend).toHaveBeenCalledTimes(2);
expect(getResourcesToSpend).toHaveBeenCalled();
});

it('should ensure a partially funded Transaction will require only missing funds', async () => {
Expand Down
Loading

0 comments on commit 986a247

Please sign in to comment.