Skip to content

Commit

Permalink
fix(deps): update pjs api (#957)
Browse files Browse the repository at this point in the history
* Update deps

* Ignore all .vscode things

* Fix from Tarik for ISanitzedEvent type

* wee readme tweaks to clarify

* Update .gitignore

Add newline

Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com>

* bump to 8.8.2

* Update README.md

"up to date" :)

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
  • Loading branch information
3 people committed Jun 14, 2022
1 parent eb0ec7f commit db4ae5e
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 120 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ yarn-error.log

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Compatibility:
| v14.x.x | Stable |
| v16.x.x | Stable |
| v17.x.x | Not Stable |
| v18.x.x | Pending |
| v18.x.x | Pending |

NOTE: Node LTS (`long term support`) versions start with an even number, and odd number versions are subject to a 6 month testing period with active support before they are unsupported. It is recommended to use sidecar with a stable actively maintained version of node.js.
NOTE: Node LTS (`long term support`) versions start with an even number, and odd number versions are subject to a 6 month testing period with active support before they are unsupported. It is recommended to use sidecar with a stable actively maintained version of node.js.

## Table of contents

Expand Down Expand Up @@ -94,7 +94,7 @@ node_modules/.bin/substrate-api-sidecar

[Click here for full endpoint docs.](https://paritytech.github.io/substrate-api-sidecar/dist/)

In the full endpoints doc, you will also find the following `trace` related endpoints :
In the full endpoints doc, you will also find the following `trace` related endpoints :
- `/experimental/blocks/{blockId}/traces/operations?actions=false`
- `/experimental/blocks/head/traces/operations?actions=false`
- `/experimental/blocks/{blockId}/traces`
Expand Down Expand Up @@ -299,18 +299,26 @@ All the commits in this repo follow the [Conventional Commits spec](https://www.

### Updating polkadot-js dependencies

1. Every Monday the polkadot-js ecosystem will usually come out with a new release. It's important that we keep up,
and read the release notes for any breaking changes or high priority updates. In order to update all the dependencies and resolutions run `yarn update-pjs-deps`.
1. Every Monday the polkadot-js ecosystem will usually come out with a new release. It's important that we keep up,
and read the release notes for any breaking changes or high priority updates. In order to update all the dependencies and resolutions run `yarn update-pjs-deps`.

- @polkadot/api [release notes](https://github.com/polkadot-js/api/releases)
- @polkadot/apps-config [release notes](https://github.com/polkadot-js/apps/releases)
- If there are any major changes to this package that includes third party type packages, its worth noting to contact the maintainers of sidecar and do a peer review of the changes in apps-config, and make sure no bugs will be inherited.
- @polkadot/util-crypto [release notes](https://github.com/polkadot-js/common/releases)
- @substrate/calc [npm release page](https://www.npmjs.com/package/@substrate/calc)

1. Ensure everything is working by running the following tests, `yarn build`, `yarn lint`, `yarn test`, `yarn test:init-e2e-tests`.
1. Ensure everything is up to date and working by running the following:
```
yarn
yarn dedupe
yarn build
yarn lint
yarn test
yarn test:init-e2e-tests
```

1. Lastly, create a PR with the updates.
1. Follow [RELEASE.md](./RELEASE.md) next if you're working through a full sidecar release.

## Hardware requirements

Expand All @@ -321,18 +329,18 @@ Sidecar is a stateless program and thus should not use any disk space.
The requirements follow the default of node.js processes which is an upper bound in HEAP memory of a little less than 2GB thus 4GB of memory should be sufficient.

### Running sidecar and a node
Please note that if you run sidecar next to a substrate node in a single machine then your system specifications should improve significantly.
Please note that if you run sidecar next to a substrate node in a single machine then your system specifications should improve significantly.
- Our official specifications related to validator nodes can be found in the polkadot wiki [page](https://wiki.polkadot.network/docs/maintain-guides-how-to-validate-polkadot#standard-hardware).
- Regarding archive nodes :
- again as mentioned in the polkadot wiki [page](https://wiki.polkadot.network/docs/maintain-sync#types-of-nodes), the space needed from an archive node depends on which block we are currently on (of the specific chain we are referring to).
- there are no other hardware requirements for an archive node since it is not time critical (archive nodes do not participate in the consensus).

### Benchmarks
During the benchmarks we performed, we concluded that sidecar would use a max of 1.1GB of RSS memory.
During the benchmarks we performed, we concluded that sidecar would use a max of 1.1GB of RSS memory.

The benchmarks were:
- using 4 threads over 12 open http connections and
- were overloading the cache with every runtime possible on polkadot.
- were overloading the cache with every runtime possible on polkadot.

Hardware specs in which the benchmarks were performed:
```
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Preparation

1. Make sure the polkadot-js dependencies are up to date. Refer to the "Updating polkadot-js dependencies" if they need to be updated.
1. Make sure the polkadot-js dependencies are up to date. Refer to the "Updating polkadot-js dependencies" section in the [README](./README.md).

1. Make sure that you've run `yarn` in this folder, and run `cargo install wasm-pack` so that that binary is available on your `$PATH`.

Expand All @@ -16,7 +16,7 @@

1. Update the substrate-api-sidecar version in the docs by going into `docs/src/openapi-v1.yaml`, and changing the `version` field under `info` to the releases respected version. Then run `yarn build:docs`.

1. Update `CHANGELOG.md` by looking at merged PRs since the last release. Follow the format of previous releases. Only record dep updates if they reflect type definition updates as those affect the users API. It will also help to sort previous PR's by "recently updated" in order to see all PR's merged since the last release.
1. Update `CHANGELOG.md` by looking at merged PRs since the last release. Follow the format of previous releases. Only record dep updates if they reflect type definition updates as those affect the users API. It will also help to sort previous PR's by "recently updated" in order to see all PR's merged since the last release.

Make sure to note if it is a high upgrade priority (e.g. it has type definitions for an upcoming runtime upgrade to a Parity maintained network).

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"update-pjs-deps": "substrate-update-pjs-deps && yarn"
},
"dependencies": {
"@polkadot/api": "^8.7.1",
"@polkadot/util-crypto": "^9.4.1",
"@polkadot/api": "8.8.2",
"@polkadot/util-crypto": "9.4.1",
"@substrate/calc": "^0.2.8",
"argparse": "^2.0.1",
"confmgr": "1.0.7",
Expand Down
6 changes: 4 additions & 2 deletions src/types/responses/SanitizedEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { GenericEventData } from '@polkadot/types';
import { IEventData } from '@polkadot/types/types';
import { Codec } from '@polkadot/types-codec/types';

import { IFrameMethod } from '.';

export interface ISanitizedEvent {
method: string | IFrameMethod;
data: GenericEventData;
data: Codec[] & IEventData;
docs?: string;
}
Loading

0 comments on commit db4ae5e

Please sign in to comment.