Skip to content

Commit

Permalink
2597 remove proof (#2774)
Browse files Browse the repository at this point in the history
* removed references to originationProof

* trigger checks

* trigger checks

* test commit

* adjusted more tests

* removed remaining origination proof artifacts

* updated smart rollup docs

* adjusted estimates
  • Loading branch information
dsawali authored Jan 2, 2024
1 parent 9689727 commit a39f699
Show file tree
Hide file tree
Showing 29 changed files with 40 additions and 238 deletions.
13 changes: 1 addition & 12 deletions docs/rpc_package.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const packedData = await client.packData({ data: { string: 'test' }, type: { pri
console.log('-- Packed data:', packedData);
```

You can simulate the `PACK` instruction from Michelson with the `packData` method.
You can simulate the `PACK` instruction from Michelson with the `packData` method.

This function will execute Tzip4 views normally referred to as 'Lambda Views'. You can learn more about Tzip4 [here](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints)
```js
Expand All @@ -111,17 +111,6 @@ const view = await client.runView({
});
```

You can obtain the `Origination Proof` for the `smart_rollup_originate` batch operation (not needed for the `smart_rollup_originate` alone)

This function will obtain the proof needed for the `smart_rollup_originate` batch method
```js
const originationProof = await client.getOriginationProof({
kernel: 'your kernel',
kind: 'PVM kind'
})
```


## Full documentation

You can find the full documentation at the following address: [https://tezostaquito.io/typedoc/classes/\_taquito_rpc.rpcclient.html](https://tezostaquito.io/typedoc/classes/_taquito_rpc.rpcclient.html)
9 changes: 4 additions & 5 deletions docs/smart_rollups.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ await op.confirmation();

##### please note
- `pvmKind` at this time the only PVM supported is `wasm_2_0_0`
- `kernel` is passed as a hexadecimal string examples can be found at [this tezos docs endpoint](https://tezos.gitlab.io/mumbai/smart_rollups.html?highlight=smart%20rollup%20originate#id1)
- `kernel` is passed as a hexadecimal string examples can be found at [this tezos docs endpoint](https://tezos.gitlab.io/active/smart_rollups.html)
- `parametersType` is a MichelsonV1Expression to define the type.
- **Please note** `originationProof` is needed origination in `batch` which can be obtained with the `rpc.getOriginationProof({kernel, kind: PVMKind})`

For more information in regards to Smart Rollup Origination please refer to the this [link](https://tezos.gitlab.io/mumbai/smart_rollups.html?highlight=smart%20rollup%20originate#id1)
For more information in regards to Smart Rollup Origination please refer to the this [link](https://tezos.gitlab.io/active/smart_rollups.html#origination)


## `smart_rollup_add_messages`
Expand All @@ -51,7 +50,7 @@ If you read closely, the message includes a `destination`, a `parameter`, and an

These messages can then be claimed back into L1 as a legitimate contract call using the `smart_rollup_execute_outbox_message` operation which we will go over in another section of this doc.

for more information, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message)
for more information, refer to [this document](https://tezos.gitlab.io/active/smart_rollups.html#external-messages)

### Example
```typescript
Expand All @@ -64,4 +63,4 @@ const op = await Tezos.contract.smartRollupAddMessages({
await op.confirmation();
```

- `message` property receives an array of encoded outbox messages. For more information on how to encode or what message gets encoded, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message)
- `message` property receives an array of encoded outbox messages. For more information on how to encode or what message gets encoded
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ CONFIGS().forEach(({ lib, rpc, setup }) => {

it('should be able to batch smart rollup originate with other operations', async () => {
const kernel = '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a'
const originationProof = await Tezos.rpc.getOriginationProof({ kernel, kind: PvmKind.WASM2 })

const batch = Tezos.contract
.batch()
.withSmartRollupOriginate({
pvmKind: PvmKind.WASM2,
kernel,
originationProof,
parametersType: { prim: 'bytes' },
})
.withOrigination({
Expand Down
16 changes: 8 additions & 8 deletions integration-tests/contract-estimation-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(613);
expect(estimate.totalCost).toEqual(143363);
expect(estimate.usingBaseFeeMutez).toEqual(613);
expect(estimate.consumedMilligas).toEqual(576347);
expect(estimate.consumedMilligas).toEqual(576402);
});

it('Verify .estimate.setDelegate result', async () => {
Expand Down Expand Up @@ -101,7 +101,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(472);
expect(estimate.totalCost).toEqual(472);
expect(estimate.usingBaseFeeMutez).toEqual(472);
expect(estimate.consumedMilligas).toEqual(1356735);
expect(estimate.consumedMilligas).toEqual(1356142);
});

it('Verify .estimate.transfer for multiple internal transfers to unallocated account', async () => {
Expand All @@ -111,40 +111,40 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
50)
).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1572);
expect(estimate.gasLimit).toEqual(1571);
expect(estimate.storageLimit).toEqual(514);
expect(estimate.suggestedFeeMutez).toEqual(643);
expect(estimate.burnFeeMutez).toEqual(128500);
expect(estimate.minimalFeeMutez).toEqual(543);
expect(estimate.totalCost).toEqual(129043);
expect(estimate.usingBaseFeeMutez).toEqual(543);
expect(estimate.consumedMilligas).toEqual(1471270);
expect(estimate.consumedMilligas).toEqual(1470671);
});

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(1868);
expect(estimate.gasLimit).toEqual(1867);
expect(estimate.storageLimit).toEqual(317);
expect(estimate.suggestedFeeMutez).toEqual(619);
expect(estimate.burnFeeMutez).toEqual(79250);
expect(estimate.minimalFeeMutez).toEqual(519);
expect(estimate.totalCost).toEqual(79769);
expect(estimate.usingBaseFeeMutez).toEqual(519);
expect(estimate.consumedMilligas).toEqual(1767848);
expect(estimate.consumedMilligas).toEqual(1766766);
});

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(2394);
expect(estimate.gasLimit).toEqual(2392);
expect(estimate.storageLimit).toEqual(634);
expect(estimate.suggestedFeeMutez).toEqual(737);
expect(estimate.burnFeeMutez).toEqual(158500);
expect(estimate.minimalFeeMutez).toEqual(637);
expect(estimate.totalCost).toEqual(159137);
expect(estimate.usingBaseFeeMutez).toEqual(637);
expect(estimate.consumedMilligas).toEqual(2293496);
expect(estimate.consumedMilligas).toEqual(2291919);
// Do the actual operation
const op2 = await contract.methods.do(originate2()).send();
await op2.confirmation();
Expand Down
1 change: 0 additions & 1 deletion integration-tests/contract-smart-rollup-originate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ CONFIGS().forEach(({ lib, rpc, setup }) => {
await op.confirmation();

expect(op.status).toEqual('applied');
expect(op.originationProof).toBeDefined();
expect(op.kernel).toEqual('23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a');
});
});
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/data/allTestsCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,6 @@ export const commonCases: TestCase[] = [
pvm_kind: PvmKind.WASM2,
kernel:
'23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a',
origination_proof:
'0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9',
parameters_ty: {
prim: 'bytes',
},
Expand Down
67 changes: 14 additions & 53 deletions integration-tests/data/metadataViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export const metadataViewsExample1 = {
michelsonStorageView: {
returnType: {
prim: 'bytes',
args: [],
annots: [ '%returnedBytes' ]
args: []
},
code: [
{
Expand All @@ -66,12 +65,7 @@ export const metadataViewsExample1 = {
annots: []
}
],
annotations: [
{
name: '%returnedBytes',
description: 'A bytes constant.'
}
]
annotations: []
}
}
]
Expand All @@ -83,8 +77,7 @@ export const metadataViewsExample1 = {
michelsonStorageView: {
returnType: {
prim: 'bytes',
args: [],
annots: [ '%returnedBytes' ]
args: []
},
code: [
{
Expand All @@ -108,12 +101,7 @@ export const metadataViewsExample1 = {
annots: []
}
],
annotations: [
{
name: '%returnedBytes',
description: 'A bytes constant.'
}
]
annotations: []
}
}
]
Expand All @@ -125,8 +113,7 @@ export const metadataViewsExample1 = {
michelsonStorageView: {
returnType: {
prim: 'bytes',
args: [],
annots: [ '%returnedBytes' ]
args: []
},
code: [
{
Expand All @@ -150,12 +137,7 @@ export const metadataViewsExample1 = {
annots: []
}
],
annotations: [
{
name: '%returnedBytes',
description: 'A bytes constant.'
}
]
annotations: []
}
}
]
Expand All @@ -167,8 +149,7 @@ export const metadataViewsExample1 = {
michelsonStorageView: {
returnType: {
prim: 'bytes',
args: [],
annots: [ '%returnedBytes' ]
args: []
},
code: [
{
Expand All @@ -192,12 +173,7 @@ export const metadataViewsExample1 = {
annots: []
}
],
annotations: [
{
name: '%returnedBytes',
description: 'A bytes constant.'
}
]
annotations: []
}
}
]
Expand All @@ -209,8 +185,7 @@ export const metadataViewsExample1 = {
michelsonStorageView: {
returnType: {
prim: 'bytes',
args: [],
annots: [ '%returnedBytes' ]
args: []
},
code: [
{
Expand All @@ -234,12 +209,7 @@ export const metadataViewsExample1 = {
annots: []
}
],
annotations: [
{
name: '%returnedBytes',
description: 'A bytes constant.'
}
]
annotations: []
}
}
]
Expand Down Expand Up @@ -276,7 +246,7 @@ export const metadataViewsExample2 = {
{
michelsonStorageView: {
parameter: { prim: 'int', args: [], annots: [ '%the_decisive_argument' ] },
returnType: { prim: 'int', args: [], annots: [ '%negative_even_number' ] },
returnType: { prim: 'int', args: [] },
code: [
{ prim: 'CAR', args: [], annots: [] },
{ prim: 'DUP', args: [], annots: [] },
Expand All @@ -303,10 +273,6 @@ export const metadataViewsExample2 = {
{
name: '%the_decisive_argument',
description: 'The integer argument if >0 this will fail.'
},
{
name: '%negative_even_number',
description: 'The result, if any, is twice the argument (%the_decisive_argument).'
}
]
}
Expand All @@ -322,7 +288,7 @@ export const metadataViewsExample2 = {
{
michelsonStorageView: {
parameter: { prim: 'nat', args: [], annots: [] },
returnType: { prim: 'nat', args: [], annots: [] },
returnType: { prim: 'nat', args: [] },
code: [
{ prim: 'DUP', args: [], annots: [] },
{ prim: 'CDR', args: [], annots: [] },
Expand Down Expand Up @@ -602,18 +568,13 @@ export const metadataViewsExample2 = {
implementations: [
{
michelsonStorageView: {
returnType: { prim: 'address', args: [], annots: [ '%ret' ] },
returnType: { prim: 'address', args: [] },
code: [
{ prim: 'DROP', args: [], annots: [] },
{ prim: 'SELF', args: [], annots: [] },
{ prim: 'ADDRESS', args: [], annots: [] }
],
annotations: [
{
name: '%ret',
description: 'The address of the (any) contract, re-obtained in Michelson.'
}
]
annotations: []
}
}
]
Expand Down
10 changes: 0 additions & 10 deletions integration-tests/rpc-nodes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,16 +466,6 @@ CONFIGS().forEach(
expect(pendingOperations.branch_delayed).toBeInstanceOf(Array);
expect(pendingOperations.branch_refused).toBeInstanceOf(Array);
});

it('Verify that rpcClient.getOriginationProof will retrieve the proof needed for smart rollup originate', async () => {
const proof = await rpcClient.getOriginationProof({
kernel: '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a',
kind: PvmKind.WASM2
})
const hexRegex = RegExp('^[a-fA-F0-9]+$');
expect(proof).toBeDefined();
expect(hexRegex.test(proof)).toEqual(true);
})
});
});
}
Expand Down
7 changes: 0 additions & 7 deletions packages/taquito-contracts-library/src/rpc-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import {
PendingOperationsV1,
PendingOperationsV2,
PendingOperationsQueryArguments,
OriginationProofParams,
RPCSimulateOperationParam,
} from '@taquito/rpc';
import { ContractsLibrary } from './taquito-contracts-library';
Expand Down Expand Up @@ -325,10 +324,4 @@ export class RpcWrapperContractsLibrary implements RpcClientInterface {
): Promise<PendingOperationsV1 | PendingOperationsV2> {
return this.rpc.getPendingOperations(args);
}
async getOriginationProof(
params: OriginationProofParams,
{ block }: RPCOptions = defaultRPCOptions
): Promise<string> {
return this.rpc.getOriginationProof(params, { block });
}
}
Loading

0 comments on commit a39f699

Please sign in to comment.