Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot 000d03e8a9 chore(release): 0.1.0-develop.49 [skip ci]
# [0.1.0-develop.49](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.48...v0.1.0-develop.49) (2023-07-25)

### Bug Fixes

* add try/catch with mutex release on optimisticUpdateCallback ([7075966](7075966227))
2023-07-25 00:08:22 +00:00
Derrick Hammer 7075966227
fix: add try/catch with mutex release on optimisticUpdateCallback 2023-07-24 20:07:04 -04:00
4 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.49](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.48...v0.1.0-develop.49) (2023-07-25)
### Bug Fixes
* add try/catch with mutex release on optimisticUpdateCallback ([7075966](https://git.lumeweb.com/LumeWeb/libethsync/commit/7075966227515151490639b0f22a804d6e3b2583))
# [0.1.0-develop.48](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.47...v0.1.0-develop.48) (2023-07-24)

4
npm-shrinkwrap.json generated
View File

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

View File

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

View File

@ -86,6 +86,7 @@ export default abstract class BaseClient extends EventEmitter {
public getCurrentBlock(): number {
return getCurrentSlot(this.config.chainConfig, this.genesisTime);
}
public getLastBlock(): number | null {
if (this._latestOptimisticUpdate) {
return capella.ssz.LightClientOptimisticUpdate.deserialize(
@ -227,7 +228,13 @@ export default abstract class BaseClient extends EventEmitter {
}
await this.optimisticMutex.acquire();
const update = await this.options.optimisticUpdateCallback();
let update: OptimisticUpdate;
try {
update = await this.options.optimisticUpdateCallback();
} catch (e) {
this.optimisticMutex.release();
throw e;
}
const verify = await optimisticUpdateVerify(
this.latestCommittee as Uint8Array[],