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

2597 remove proof #2773

Closed
wants to merge 3 commits into from
Closed
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
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)
1 change: 0 additions & 1 deletion docs/smart_rollups.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ await op.confirmation();
- `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)
- `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)

Expand Down
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
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
10 changes: 0 additions & 10 deletions integration-tests/rpc-nodes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,16 +454,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
12 changes: 4 additions & 8 deletions packages/taquito-contracts-library/src/rpc-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import {
AllTicketBalances,
PendingOperations,
PendingOperationsQueryArguments,
OriginationProofParams,
RPCSimulateOperationParam,
} from '@taquito/rpc';
import { ContractsLibrary } from './taquito-contracts-library';
Expand All @@ -58,7 +57,10 @@ import { ContractsLibrary } from './taquito-contracts-library';
*
*/
export class RpcWrapperContractsLibrary implements RpcClientInterface {
constructor(private rpc: RpcClientInterface, private contractslibrary: ContractsLibrary) {}
constructor(
private rpc: RpcClientInterface,
private contractslibrary: ContractsLibrary
) {}

async getContract(
address: string,
Expand Down Expand Up @@ -334,10 +336,4 @@ export class RpcWrapperContractsLibrary implements RpcClientInterface {
async getPendingOperations(args: PendingOperationsQueryArguments): Promise<PendingOperations> {
return this.rpc.getPendingOperations(args);
}
async getOriginationProof(
params: OriginationProofParams,
{ block }: RPCOptions = defaultRPCOptions
): Promise<string> {
return this.rpc.getOriginationProof(params, { block });
}
}
1 change: 0 additions & 1 deletion packages/taquito-local-forging/src/schema/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export const SmartRollupOriginateSchema = {
storage_limit: CODEC.ZARITH,
pvm_kind: CODEC.PVM_KIND,
kernel: CODEC.PADDED_BYTES,
origination_proof: CODEC.PADDED_BYTES,
parameters_ty: CODEC.VALUE,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('Forge and parse operations default protocol', () => {
},
],
};

expect(() => {
localForger.forge(operation);
}).toThrow(InvalidOperationKindError);
Expand Down Expand Up @@ -287,8 +288,6 @@ describe('Forge and parse operations default protocol', () => {
pvm_kind: 'wasm_2_0_0',
kernel:
'23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a',
origination_proof:
'0300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9',
parameters_ty: {
prim: 'bytes',
},
Expand All @@ -299,9 +298,6 @@ describe('Forge and parse operations default protocol', () => {
expect(forged).toContain(
'0000035323212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a'
);
expect(forged).toContain(
'000000770300020c4a316fa1079bfc23dac5ecc609ab10e26490e378a81e774c51176040bea18030fab8a3adde4b553c4d391e9cd19ee13b17941c1f49c040d621bbfbea964993810764757261626c658108726561646f6e6c79d00b749948da9186d29aed2f9327b46793f18b1e6499c40f0ddbf0bf785e85e2e9'
);
expect(forged).toContain('000000020369');
});

Expand Down
3 changes: 0 additions & 3 deletions packages/taquito-rpc/src/rpc-client-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import {
AllTicketBalances,
PendingOperations,
PendingOperationsQueryArguments,
OriginationProofParams,
RPCSimulateOperationParam,
} from './types';

Expand Down Expand Up @@ -133,7 +132,6 @@ export interface RpcClientInterface {
): Promise<string>;
getAllTicketBalances(contract: string, options?: RPCOptions): Promise<AllTicketBalances>;
getPendingOperations(args: PendingOperationsQueryArguments): Promise<PendingOperations>;
getOriginationProof(params: OriginationProofParams, options?: RPCOptions): Promise<string>;
}

export enum RPCMethodName {
Expand Down Expand Up @@ -177,5 +175,4 @@ export enum RPCMethodName {
GET_TICKET_BALANCE = 'getTicketBalance',
GET_ALL_TICKET_BALANCES = 'getAllTicketBalances',
GET_PENDING_OPERATIONS = 'getPendingOperations',
GET_ORIGINATION_PROOF = 'getOriginationProof',
}
28 changes: 1 addition & 27 deletions packages/taquito-rpc/src/rpc-client-modules/rpc-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
AllTicketBalances,
PendingOperationsQueryArguments,
PendingOperations,
OriginationProofParams,
RPCSimulateOperationParam,
} from '../types';
import { InvalidAddressError, InvalidContractAddressError } from '@taquito/core';
Expand All @@ -74,8 +73,7 @@ type RpcMethodParam =
| BigMapKey
| BakingRightsQueryArguments
| PendingOperationsQueryArguments
| EndorsingRightsQueryArguments
| OriginationProofParams;
| EndorsingRightsQueryArguments;

const defaultTtl = 1000;

Expand Down Expand Up @@ -1272,28 +1270,4 @@ export class RpcClientCache implements RpcClientInterface {
return response;
}
}

/**
*
* @param params contains the PVM kind and kernel to generate the origination proof from
* @description rpc call to generate the origination proof needed for the smart rollup originate operation
* @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes
*/
async getOriginationProof(
params: OriginationProofParams,
{ block }: RPCOptions = defaultRPCOptions
): Promise<string> {
const key = this.formatCacheKey(
this.rpcClient.getRpcUrl(),
RPCMethodName.GET_ORIGINATION_PROOF,
[block, params]
);
if (this.has(key)) {
return this.get(key);
} else {
const response = this.rpcClient.getOriginationProof(params, { block });
this.put(key, response);
return response;
}
}
}
22 changes: 0 additions & 22 deletions packages/taquito-rpc/src/taquito-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import {
AllTicketBalances,
PendingOperationsQueryArguments,
PendingOperations,
OriginationProofParams,
RPCSimulateOperationParam,
} from './types';
import { castToBigNumber } from './utils/utils';
Expand Down Expand Up @@ -1226,25 +1225,4 @@ export class RpcClient implements RpcClientInterface {
query: args,
});
}

/**
*
* @param params contains the PVM kind and kernel to generate the origination proof from
* @description rpc call to generate the origination proof needed for a smart rollup originate operation
* @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes
*/
async getOriginationProof(
params: OriginationProofParams,
{ block }: { block: string } = defaultRPCOptions
): Promise<string> {
return this.httpBackend.createRequest<string>(
{
url: this.createURL(
`/chains/${this.chain}/blocks/${block}/context/smart_rollups/all/origination_proof`
),
method: 'POST',
},
params
);
}
}
Loading