Skip to content

Commit

Permalink
feat: removed endorsement compatiblity but kept rpc types and readPro…
Browse files Browse the repository at this point in the history
…vider for user query old block

BREAKING CHANGE: PollingSubscribeProvider doesn't filter endorsement anymore and removed rpc
entrypoints using param version  0

re #3036
  • Loading branch information
hui-an-yang committed Sep 6, 2024
1 parent cd127ce commit 2ccc4ee
Show file tree
Hide file tree
Showing 14 changed files with 697 additions and 3,384 deletions.
2 changes: 1 addition & 1 deletion docs/consensus_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Consensus Keys
author: Davis Sawali & Hui-An Yang
---

The "consensus key" feature allows bakers to use a different key, called the consensus key. It will allow for baking and signing consensus operations (i.e. preattestation/preendorsements and attestation/endorsements). For more detailed information on consensus keys, refer to [this documentation](https://tezos.gitlab.io/protocols/015_lima.html?highlight=update%20consensus%20key#consensus-key)
The "consensus key" feature allows bakers to use a different key, called the consensus key. It will allow for baking and signing consensus operations (i.e. preattestation and attestation). For more detailed information on consensus keys, refer to [this documentation](https://tezos.gitlab.io/protocols/015_lima.html?highlight=update%20consensus%20key#consensus-key)

Starting from Lima protocol, these 2 new operations will be available:

Expand Down
6 changes: 1 addition & 5 deletions example/example-streamer-custom-retry-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ async function example() {
and: [{ source: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'attestation' }]
}

const bakerEndorsementFilter = {
and: [{ source: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'endorsement' }]
}

const bakerDelegation = {
and: [{ destination: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'delegation' }]
}

tezos.stream.subscribeOperation({
or: [bakerAttestationFilter, bakerEndorsementFilter, bakerDelegation]
or: [bakerAttestationFilter, bakerDelegation]
})
}

Expand Down
6 changes: 1 addition & 5 deletions example/example-streamer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ async function example() {
and: [{ source: 'tz1bQMn5xYFbX6geRxqvuAiTywsCtNywawxH' }, { kind: 'attestation' }]
}

const bakerEndorsementFilter = {
and: [{ source: 'tz1bQMn5xYFbX6geRxqvuAiTywsCtNywawxH' }, { kind: 'endorsement' }]
}

const bakerDelegation = {
and: [{ destination: 'tz1bQMn5xYFbX6geRxqvuAiTywsCtNywawxH' }, { kind: 'delegation' }]
}

const sub = tezos.stream.subscribeOperation({
or: [bakerAttestationFilter, bakerEndorsementFilter, bakerDelegation]
or: [bakerAttestationFilter, bakerDelegation]
})

sub.on('data', console.log)
Expand Down
2 changes: 1 addition & 1 deletion packages/taquito-rpc/src/rpc-client-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import {

export interface RPCOptions {
block: string;
version?: 0 | 1 | '0' | '1';
version?: 1 | '1';
}

export const defaultChain = 'main';
Expand Down
6 changes: 3 additions & 3 deletions packages/taquito-rpc/src/rpc-client-modules/rpc-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ export class RpcClientCache implements RpcClientInterface {
* @param options contains generic configuration for rpc calls to specified block (default to head) and version.
* @description All the information about a block
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id
* @example getBlock() will default to `/main/chains/block/head?version=0` which shows { kind: endorsement }
* @example getBlock({ block: 'head~2', version: 1 }) will return an offset of 2 from head blocks and shows { kind: attestation }
* @example getBlock() will default to `/main/chains/block/head?version=1`
* @example getBlock({ block: 'head~2') will return an offset of 2 from head blocks
* @example getBlock({ block: 'BL8fTiWcSxWCjiMVnDkbh6EuhqVPZzgWheJ2dqwrxYRm9AephXh~2' }) will return an offset of 2 blocks from given block hash..
*/
async getBlock({ block }: RPCOptions = defaultRPCOptions): Promise<BlockResponse> {
Expand Down Expand Up @@ -1272,7 +1272,7 @@ export class RpcClientCache implements RpcClientInterface {

/**
* @description List the prevalidated operations in mempool (accessibility of mempool depends on each rpc endpoint)
* @param args has 5 optional properties. We support version 2
* @param args has 5 optional properties
* @default args { version: '2', validated: true, refused: true, outdated, true, branchRefused: true, branchDelayed: true, validationPass: undefined }
*/
async getPendingOperations(
Expand Down
6 changes: 3 additions & 3 deletions packages/taquito-rpc/src/taquito-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ export class RpcClient implements RpcClientInterface {
* @param options contains generic configuration for rpc calls to specified block (default to head) and version.
* @description All the information about a block
* @see https://tezos.gitlab.io/active/rpc.html#get-block-id
* @example getBlock() will default to `/main/chains/block/head?version=1` which shows { kind: attestation }
* @example getBlock({ block: 'head~2', version: 0 }) will return an offset of 2 from head blocks and shows { kind: endorsement }
* @example getBlock() will default to `/main/chains/block/head?version=1`
* @example getBlock({ block: 'head~2' }) will return an offset of 2 from head blocks
* @example getBlock({ block: 'BL8fTiWcSxWCjiMVnDkbh6EuhqVPZzgWheJ2dqwrxYRm9AephXh~2' }) will return an offset of 2 blocks from given block hash..
*/
async getBlock({ block, version }: RPCOptions = defaultRPCOptions): Promise<BlockResponse> {
Expand Down Expand Up @@ -1215,7 +1215,7 @@ export class RpcClient implements RpcClientInterface {

/**
* @description List the prevalidated operations in mempool (accessibility of mempool depends on each rpc endpoint)
* @param args has 5 optional properties. We support version 2
* @param args has 5 optional properties
* @default args { version: '2', validated: true, refused: true, outdated, true, branchRefused: true, branchDelayed: true, validationPass: undefined }
* @see https://gitlab.com/tezos/tezos/-/blob/master/docs/api/paris-mempool-openapi-rc.json
*/
Expand Down
Loading

0 comments on commit 2ccc4ee

Please sign in to comment.