Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 1895495520 chore(release): 0.1.0-develop.40 [skip ci]
# [0.1.0-develop.40](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.39...v0.1.0-develop.40) (2023-07-14)

### Bug Fixes

* add a sync delay option so that the bls verification does not hog cpu ([824dcd9](824dcd9633))
2023-07-14 13:23:17 +00:00
Derrick Hammer 8582db4eb3
Merge remote-tracking branch 'origin/develop' into develop 2023-07-14 09:22:09 -04:00
Derrick Hammer 824dcd9633
fix: add a sync delay option so that the bls verification does not hog cpu 2023-07-14 09:21:52 -04:00
4 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.40](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.39...v0.1.0-develop.40) (2023-07-14)
### Bug Fixes
* add a sync delay option so that the bls verification does not hog cpu ([824dcd9](https://git.lumeweb.com/LumeWeb/libethsync/commit/824dcd96339410ffa9f0afb744a1baf3bed722d6))
# [0.1.0-develop.39](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.38...v0.1.0-develop.39) (2023-07-13) # [0.1.0-develop.39](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.38...v0.1.0-develop.39) (2023-07-13)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libethclient", "name": "@lumeweb/libethclient",
"version": "0.1.0-develop.39", "version": "0.1.0-develop.40",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libethclient", "name": "@lumeweb/libethclient",
"version": "0.1.0-develop.39", "version": "0.1.0-develop.40",
"dependencies": { "dependencies": {
"@chainsafe/as-sha256": "^0.3.1", "@chainsafe/as-sha256": "^0.3.1",
"@chainsafe/bls": "7.1.1", "@chainsafe/bls": "7.1.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libethsync", "name": "@lumeweb/libethsync",
"version": "0.1.0-develop.39", "version": "0.1.0-develop.40",
"type": "module", "type": "module",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -25,6 +25,7 @@ export interface BaseClientOptions {
prover: IProver; prover: IProver;
store: IStore; store: IStore;
optimisticUpdateCallback: OptimisticUpdateCallback; optimisticUpdateCallback: OptimisticUpdateCallback;
syncDelay?: number;
} }
export default abstract class BaseClient { export default abstract class BaseClient {
@ -140,6 +141,12 @@ export default abstract class BaseClient {
await this.options.store.addUpdate(curPeriod, update); await this.options.store.addUpdate(curPeriod, update);
startCommittee = validOrCommittee as Uint8Array[]; startCommittee = validOrCommittee as Uint8Array[];
if (this.options.syncDelay) {
await new Promise((resolve) =>
setTimeout(resolve, this.options.syncDelay),
);
}
} }
} catch (e) { } catch (e) {
console.error(`failed to fetch sync update for period(${startPeriod})`); console.error(`failed to fetch sync update for period(${startPeriod})`);