Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: configured paris branch #2911

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
include:
- testnet: oxfordnet
testnet_uppercase: OXFORDNET
- testnet: parisnet
testnet_uppercase: PARISNET
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
1 change: 1 addition & 0 deletions apps/taquito-test-dapp/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ export const contractAddress = {
mainnet: "KT1ShtH2zCrKMuWGRejEd6RAcnePwxBQeMAN",
ghostnet: "KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5",
oxfordnet: "KT1GYx1KDhMQt2GJEztRh8EyYxJUPM6fnAMM",
parisnet: "KT1LBQmSDGsRj4LFa2bsCsZLkGCtmRFVVcPh",
};
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"oxfordbox",
"oxfordnet",
"oxheadalpha",
"parisnet",
"Pkhfrom",
"preattestation",
"precommit",
Expand Down
2 changes: 1 addition & 1 deletion example/deploy-test-dapp-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { InMemorySigner } from '@taquito/signer'
import { code, storage } from './data/test-dapp-contract';

// update the targeted rpc url before running
const rpcUrl = 'https://nairobinet.ecadinfra.com/'
const rpcUrl = 'http://parisnet.i.ecadinfra.com:8732'

originate(rpcUrl)

Expand Down
84 changes: 42 additions & 42 deletions integration-tests/__tests__/contract/estimation-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
const estimate = await LowAmountTez.estimate.transfer({ to: await Tezos.signer.publicKeyHash(), amount: 0.019 });
expect(estimate.gasLimit).toEqual(101);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(188);
expect(estimate.suggestedFeeMutez).toEqual(186);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(168);
expect(estimate.totalCost).toEqual(168);
expect(estimate.usingBaseFeeMutez).toEqual(168);
expect(estimate.minimalFeeMutez).toEqual(166);
expect(estimate.totalCost).toEqual(166);
expect(estimate.usingBaseFeeMutez).toEqual(166);
expect(estimate.consumedMilligas).toEqual(100040);
});

it('Verify .estimate.transfer with unallocated destination', async () => {
const estimate = await LowAmountTez.estimate.transfer({ to: await (await createAddress()).signer.publicKeyHash(), amount: 0.017 });
expect(estimate.gasLimit).toEqual(101);
expect(estimate.storageLimit).toEqual(277);
expect(estimate.suggestedFeeMutez).toEqual(188);
expect(estimate.suggestedFeeMutez).toEqual(186);
expect(estimate.burnFeeMutez).toEqual(69250);
expect(estimate.minimalFeeMutez).toEqual(168);
expect(estimate.totalCost).toEqual(69418);
expect(estimate.usingBaseFeeMutez).toEqual(168);
expect(estimate.minimalFeeMutez).toEqual(166);
expect(estimate.totalCost).toEqual(69416);
expect(estimate.usingBaseFeeMutez).toEqual(166);
expect(estimate.consumedMilligas).toEqual(100040);
});

Expand All @@ -69,11 +69,11 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
});
expect(estimate.gasLimit).toEqual(677);
expect(estimate.storageLimit).toEqual(591);
expect(estimate.suggestedFeeMutez).toEqual(537);
expect(estimate.suggestedFeeMutez).toEqual(535);
expect(estimate.burnFeeMutez).toEqual(147750);
expect(estimate.minimalFeeMutez).toEqual(517);
expect(estimate.totalCost).toEqual(148267);
expect(estimate.usingBaseFeeMutez).toEqual(517);
expect(estimate.minimalFeeMutez).toEqual(515);
expect(estimate.totalCost).toEqual(148265);
expect(estimate.usingBaseFeeMutez).toEqual(515);
expect(estimate.consumedMilligas).toEqual(676402);
});

Expand All @@ -84,25 +84,25 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
});
expect(estimate.gasLimit).toEqual(100);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(183);
expect(estimate.suggestedFeeMutez).toEqual(181);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(163);
expect(estimate.totalCost).toEqual(163);
expect(estimate.usingBaseFeeMutez).toEqual(163);
expect(estimate.minimalFeeMutez).toEqual(161);
expect(estimate.totalCost).toEqual(161);
expect(estimate.usingBaseFeeMutez).toEqual(161);
expect(estimate.consumedMilligas).toEqual(100000);
});

it('Verify .estimate.transfer for internal transfer to allocated implicit', async () => {
const tx = contract.methods.do(MANAGER_LAMBDA.transferImplicit(knownBaker, 5)).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1457);
expect(estimate.gasLimit).toEqual(1456);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(396);
expect(estimate.suggestedFeeMutez).toEqual(394);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(376);
expect(estimate.totalCost).toEqual(376);
expect(estimate.usingBaseFeeMutez).toEqual(376);
expect(estimate.consumedMilligas).toEqual(1456228);
expect(estimate.minimalFeeMutez).toEqual(374);
expect(estimate.totalCost).toEqual(374);
expect(estimate.usingBaseFeeMutez).toEqual(374);
expect(estimate.consumedMilligas).toEqual(1455884);
});

it('Verify .estimate.transfer for multiple internal transfers to unallocated account', async () => {
Expand All @@ -114,38 +114,38 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1571);
expect(estimate.storageLimit).toEqual(534);
expect(estimate.suggestedFeeMutez).toEqual(467);
expect(estimate.suggestedFeeMutez).toEqual(465);
expect(estimate.burnFeeMutez).toEqual(133500);
expect(estimate.minimalFeeMutez).toEqual(447);
expect(estimate.totalCost).toEqual(133947);
expect(estimate.usingBaseFeeMutez).toEqual(447);
expect(estimate.consumedMilligas).toEqual(1570757);
expect(estimate.minimalFeeMutez).toEqual(445);
expect(estimate.totalCost).toEqual(133945);
expect(estimate.usingBaseFeeMutez).toEqual(445);
expect(estimate.consumedMilligas).toEqual(1570413);
});

it('Verify .estimate.transfer for internal origination', async () => {
const tx = contract.methods.do(originate()).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1867);
expect(estimate.storageLimit).toEqual(337);
expect(estimate.suggestedFeeMutez).toEqual(443);
expect(estimate.suggestedFeeMutez).toEqual(441);
expect(estimate.burnFeeMutez).toEqual(84250);
expect(estimate.minimalFeeMutez).toEqual(423);
expect(estimate.totalCost).toEqual(84673);
expect(estimate.usingBaseFeeMutez).toEqual(423);
expect(estimate.consumedMilligas).toEqual(1866852);
expect(estimate.minimalFeeMutez).toEqual(421);
expect(estimate.totalCost).toEqual(84671);
expect(estimate.usingBaseFeeMutez).toEqual(421);
expect(estimate.consumedMilligas).toEqual(1866508);
});

it('Verify .estimate.transfer for multiple internal originations', async () => {
const tx = contract.methods.do(originate2()).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(2393);
expect(estimate.gasLimit).toEqual(2392);
expect(estimate.storageLimit).toEqual(654);
expect(estimate.suggestedFeeMutez).toEqual(561);
expect(estimate.suggestedFeeMutez).toEqual(559);
expect(estimate.burnFeeMutez).toEqual(163500);
expect(estimate.minimalFeeMutez).toEqual(541);
expect(estimate.totalCost).toEqual(164041);
expect(estimate.usingBaseFeeMutez).toEqual(541);
expect(estimate.consumedMilligas).toEqual(2392005);
expect(estimate.minimalFeeMutez).toEqual(539);
expect(estimate.totalCost).toEqual(164039);
expect(estimate.usingBaseFeeMutez).toEqual(539);
expect(estimate.consumedMilligas).toEqual(2391661);
// Do the actual operation
const op2 = await contract.methods.do(originate2()).send();
await op2.confirmation();
Expand Down Expand Up @@ -176,11 +176,11 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
let estimate = await LowAmountTez.estimate.transfer({ to: await Tezos.signer.publicKeyHash(), mutez: true, amount: amt - (1382 + getRevealFee(await LowAmountTez.signer.publicKeyHash())) });
expect(estimate.gasLimit).toEqual(101);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(187);
expect(estimate.suggestedFeeMutez).toEqual(185);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(167);
expect(estimate.totalCost).toEqual(167);
expect(estimate.usingBaseFeeMutez).toEqual(167);
expect(estimate.minimalFeeMutez).toEqual(165);
expect(estimate.totalCost).toEqual(165);
expect(estimate.usingBaseFeeMutez).toEqual(165);
expect(estimate.consumedMilligas).toEqual(100040);
});

Expand Down
25 changes: 21 additions & 4 deletions integration-tests/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { KnownContracts } from './known-contracts';
import { knownContractsProtoALph } from './known-contracts-ProtoALph';
import { knownContractsPtGhostnet } from './known-contracts-PtGhostnet';
import { knownContractsProxfordY } from './known-contracts-ProxfordY';
import { knownContractsPtParisBQ } from './known-contracts-PtParisBQ';
import { knownContractsPtNairobi } from './known-contracts-PtNairobi';

const nodeCrypto = require('crypto');
Expand All @@ -32,7 +33,7 @@ const forgers: ForgerType[] = [ForgerType.COMPOSITE];

// user running integration test can pass environment variable TEZOS_NETWORK_TYPE=sandbox to specify which network to run against
export enum NetworkType {
TESTNET, // corresponds ghostnet, oxfordnet and weeklynet etc.
TESTNET, // corresponds ghostnet, oxfordnet, parisnet and weeklynet etc.
SANDBOX, // corresponds to flextesa local chain
}

Expand Down Expand Up @@ -141,6 +142,18 @@ const oxfordnetEphemeral: Config =
const oxfordnetSecretKey: Config =
{ ...oxfordnetEphemeral, ...{ signerConfig: defaultSecretKey }, ...{ defaultRpc: 'http://ecad-oxfordnet-full:8732' } };

const parisnetEphemeral: Config =
defaultConfig({
networkName: 'PARISNET',
protocol: Protocols.PtParisBQ,
defaultRpc: 'http://parisnet.i.ecadinfra.com:8732/',
knownContracts: knownContractsPtParisBQ,
signerConfig: defaultEphemeralConfig('https://keygen.ecadinfra.com/parisnet')
});

const parisnetSecretKey: Config =
{ ...oxfordnetEphemeral, ...{ signerConfig: defaultSecretKey }, ...{ defaultRpc: 'http://parisnet.i.ecadinfra.com:8732/' } };

const nairobinetSecretKey: Config =
defaultConfig({
networkName: 'NAIROBINET',
Expand Down Expand Up @@ -177,23 +190,27 @@ const weeklynetSecretKey: Config =
const providers: Config[] = [];

if (process.env['RUN_WITH_SECRET_KEY']) {
providers.push(oxfordnetSecretKey);
providers.push(oxfordnetSecretKey, parisnetSecretKey);
} else if (process.env['RUN_PARISNET_WITH_SECRET_KEY']) {
providers.push(parisnetSecretKey);
} else if (process.env['RUN_OXFORDNET_WITH_SECRET_KEY']) {
providers.push(oxfordnetSecretKey);
} else if (process.env['RUN_GHOSTNET_WITH_SECRET_KEY']) {
providers.push(ghostnetSecretKey);
} else if(process.env['RUN_NAIROBINET_WITH_SECRET_KEY']) {
} else if (process.env['RUN_NAIROBINET_WITH_SECRET_KEY']) {
providers.push(nairobinetSecretKey);
} else if (process.env['RUN_WEEKLYNET_WITH_SECRET_KEY']) {
providers.push(weeklynetSecretKey);
} else if (process.env['PARISNET']) {
providers.push(parisnetEphemeral);
} else if (process.env['OXFORDNET']) {
providers.push(oxfordnetEphemeral);
} else if (process.env['GHOSTNET']) {
providers.push(ghostnetEphemeral);
} else if (process.env['WEEKLYNET']) {
providers.push(weeklynetEphemeral);
} else {
providers.push(oxfordnetEphemeral);
providers.push(oxfordnetEphemeral, parisnetEphemeral);
}

const setupForger = (Tezos: TezosToolkit, forger: ForgerType): void => {
Expand Down
8 changes: 8 additions & 0 deletions integration-tests/known-contracts-PtParisBQ.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { KnownContracts } from './known-contracts';
export const knownContractsPtParisBQ: KnownContracts = {
contract: "KT1PgBAc5e5vhzUyJoQxSEcCkZyqVadurQfN",
bigMapContract: "KT19SNmdj7frTk4gacoL6R96sRD455HUtryH",
tzip12BigMapOffChainContract: "KT1NJs9CnuYJY8wmKxscf8abmc9iHFk1X7fK",
saplingContract: "KT1U2ZBtHKD8ayWkRkrvLzJq5GAYiWEBUxhg",
onChainViewContractAddress: "KT1FmyfnNNggnhHZwJNTCqWFEN6pkXwpEv5T",
};
2 changes: 2 additions & 0 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"test:secret-key": "RUN_WITH_SECRET_KEY=true jest --runInBand",
"test:oxfordnet": "OXFORDNET=true jest",
"test:oxfordnet-secret-key": "RUN_OXFORDNET_WITH_SECRET_KEY=true jest --runInBand",
"test:parisnet": "PARISNET=true jest",
"test:parisnet-secret-key": "RUN_PARISNET_WITH_SECRET_KEY=true jest --runInBand",
"test:nairobinet-secret-key": "RUN_NAIROBINET_WITH_SECRET_KEY=true jest --runInBand",
"test:weeklynet": "WEEKLYNET=true jest",
"test:weeklynet-secret-key": "RUN_WEEKLYNET_WITH_SECRET_KEY=true jest --runInBand",
Expand Down
4 changes: 3 additions & 1 deletion packages/taquito-local-forging/src/protocols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export enum ProtocolsHash {
PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1',
PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf',
ProxfordY = 'ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH',
PtParisBQ = 'PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz',
ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK',
}

Expand All @@ -37,7 +38,8 @@ const protoLevel: Record<ProtocolsHash, number> = {
PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1: 16,
PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf: 17,
ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH: 19,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 20,
PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz: 20,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 21,
};

export function ProtoInferiorTo(a: ProtocolsHash, b: ProtocolsHash): boolean {
Expand Down
4 changes: 3 additions & 1 deletion packages/taquito-michel-codec/src/michelson-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export enum Protocol {
PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1',
PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf',
ProxfordY = 'ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH',
PtParisBQ = 'PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz',
ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK', // temporary protocol hash
}

Expand Down Expand Up @@ -434,7 +435,8 @@ const protoLevel: Record<ProtocolID, number> = {
PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1: 16,
PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf: 17,
ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH: 19,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 20,
PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz: 20,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 21,
};

export function ProtoGreaterOrEqual(a: ProtocolID, b: ProtocolID): boolean {
Expand Down
2 changes: 2 additions & 0 deletions packages/taquito/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export enum Protocols {
PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1',
PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf',
ProxfordY = 'ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH',
PtParisBQ = 'PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz',
ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK',
}

Expand Down Expand Up @@ -107,6 +108,7 @@ export enum ChainIds {
MUMBAINET2 = 'NetXgbcrNtXD2yA',
NAIROBINET = 'NetXyuzvDo2Ugzb',
OXFORDNET2 = 'NetXxWsskGahzQB',
PARISNET = 'NetXo8SqH1c38SS',
}

// A fixed fee reveal operation gasLimit accepted by both simulate and injection endpoint is between 1.2-5 times of actual gas consumption (3.5 fails occasionally with gas exhausted; 4 fails occasionally with fee too low)
Expand Down
Loading