Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 8993ba67d4 chore(release): 0.1.0-develop.64 [skip ci]
# [0.1.0-develop.64](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.63...v0.1.0-develop.64) (2023-10-29)

### Bug Fixes

* wrap sync in try/catch and unlock mutex in a finally ([0963794](09637948e7))
2023-10-29 01:59:29 +00:00
Derrick Hammer fd3d5facac
Merge remote-tracking branch 'origin/develop' into develop 2023-10-28 21:58:38 -04:00
Derrick Hammer 09637948e7
fix: wrap sync in try/catch and unlock mutex in a finally 2023-10-28 21:57:59 -04:00
4 changed files with 24 additions and 13 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.64](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.63...v0.1.0-develop.64) (2023-10-29)
### Bug Fixes
* wrap sync in try/catch and unlock mutex in a finally ([0963794](https://git.lumeweb.com/LumeWeb/libethsync/commit/09637948e71e88c66b9e40389b4a46c60659f6e3))
# [0.1.0-develop.63](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.62...v0.1.0-develop.63) (2023-10-24) # [0.1.0-develop.63](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.62...v0.1.0-develop.63) (2023-10-24)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libethsync", "name": "@lumeweb/libethsync",
"version": "0.1.0-develop.63", "version": "0.1.0-develop.64",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libethsync", "name": "@lumeweb/libethsync",
"version": "0.1.0-develop.63", "version": "0.1.0-develop.64",
"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.63", "version": "0.1.0-develop.64",
"type": "module", "type": "module",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -170,18 +170,22 @@ export default abstract class BaseClient extends EventEmitter {
protected async _sync() { protected async _sync() {
await this.syncMutex.acquire(); await this.syncMutex.acquire();
const currentPeriod = this.getCurrentPeriod(); try {
if (currentPeriod > this._latestPeriod) { const currentPeriod = this.getCurrentPeriod();
if (!this.booted) { if (currentPeriod > this._latestPeriod) {
this.latestCommittee = await this.syncFromGenesis(); if (!this.booted) {
} else { this.latestCommittee = await this.syncFromGenesis();
this.latestCommittee = await this.syncFromLastUpdate(); } else {
this.latestCommittee = await this.syncFromLastUpdate();
}
this._latestPeriod = currentPeriod;
this.emit("synced");
} }
this._latestPeriod = currentPeriod; } catch (e) {
this.emit("synced"); console.log(e);
} finally {
this.syncMutex.release();
} }
this.syncMutex.release();
} }
protected async subscribe(callback?: (ei: ExecutionInfo) => void) { protected async subscribe(callback?: (ei: ExecutionInfo) => void) {