Commit Graph

48 Commits

Author SHA1 Message Date
Derrick Hammer e567d5017d
refactor: call getLatestExecution in sync and add an arg to getLatestExecution to skip syncing 2023-07-13 04:35:29 -04:00
Derrick Hammer f68688ab61
refactor: have isSynced check the period and the block 2023-07-13 04:32:18 -04:00
Derrick Hammer 661e146636
feat: add getCurrentBlock and getLastBlock methods 2023-07-13 04:31:55 -04:00
Derrick Hammer 93ab07c5c3
refactor: make getLatestExecution public 2023-07-13 04:05:34 -04:00
Derrick Hammer 391a4f968a
refactor: if we have a _latestOptimisticUpdate, check the estimated current block against the block we have, and return it as cached data if we don't need to fetch again. Also use a mutex to prevent race conditions 2023-07-13 04:00:42 -04:00
Derrick Hammer 36f9f4c910
tidy: unneeded var 2023-07-13 03:47:44 -04:00
Derrick Hammer c5a2dc86e1
refactor: don't run automatic optimistic updates 2023-07-13 03:35:33 -04:00
Derrick Hammer 11791ff08b
refactor: split subscribe into syncToLatestBlock 2023-07-13 03:18:05 -04:00
Derrick Hammer 4836ddb32e
style: reformat 2023-07-13 03:14:06 -04:00
Derrick Hammer b3e5607132
refactor: store optimistic update back into _latestOptimisticUpdate with a getter. 2023-07-13 03:13:22 -04:00
Derrick Hammer a7786fa21c
style: fix typos 2023-07-13 03:12:49 -04:00
Derrick Hammer c3b47e67e7
fix: add optimisticUpdateCallback to client factory 2023-07-13 02:53:23 -04:00
Derrick Hammer 977d33b768
refactor: make optimisticUpdateCallback a dedicated type 2023-07-13 02:53:00 -04:00
Derrick Hammer 464fb21095
fix: add optimisticUpdateCallback to options 2023-07-13 02:33:07 -04:00
Derrick Hammer 4be6c339c7
chore: cleanup imports 2023-07-13 02:32:46 -04:00
Derrick Hammer 51d6d23942
refactor: getLatestExecution needs to actually call optimistic update, but add a callback in the client options to avoid creating a subclass 2023-07-13 02:25:05 -04:00
Derrick Hammer 5aa37d4a61
refactor: don't use un-needed for loop 2023-07-13 01:46:45 -04:00
Derrick Hammer 17cb00231c
fix: simplify logic and use LightClientUpdate.fromJson 2023-07-13 01:45:43 -04:00
Derrick Hammer 76e22fa342
fix: use _client not client 2023-07-13 01:44:26 -04:00
Derrick Hammer 481757e019
fix: pass client to prover after creating client in factory. don't try to parse thr messages 2023-07-13 01:44:25 -04:00
Derrick Hammer baa9562749
fix: fix import 2023-07-12 17:59:56 -04:00
Derrick Hammer 6408098050
refactor: heavily simplify and consolidate implementations to just use light sync updates and not the optimistic_update endpoint, and use a generic callback interface 2023-07-12 17:40:59 -04:00
Derrick Hammer 30c7caace7
refactor: store latest optimistic update in the node client class to be referenced 2023-07-12 02:09:35 -04:00
Derrick Hammer 822b0b46b6
fix: syncFromGenesis was a no-op 2023-07-11 16:54:13 -04:00
Derrick Hammer 4f45d0ac24
chore: cleanup imports 2023-07-11 04:37:27 -04:00
Derrick Hammer 5c8394af2d
fix: @noble/curves import 2023-07-11 04:36:56 -04:00
Derrick Hammer 2a27a16c25
refactor: create the IClientVerifyingProvider child interface and add rpcCall to the client Client instead of exposing the provider in a getter 2023-07-11 04:27:11 -04:00
Derrick Hammer b85e1779ee
feat: add getter for provider 2023-07-11 04:15:35 -04:00
Derrick Hammer 08840308f8
fix: update ProverRequestCallback type to return a promise 2023-07-11 04:13:44 -04:00
Derrick Hammer f353b3e102
fix: beacon url is not used on the client side 2023-07-11 04:08:46 -04:00
Derrick Hammer 0f8746dac2
fix: fix reference to isValidLightClientHeader 2023-07-11 03:43:12 -04:00
Derrick Hammer 6f07421fe8
fix: implement isValidLightClientHeader 2023-07-11 03:24:38 -04:00
Derrick Hammer 8b1191165a
fix: further chainConfig fixes 2023-07-11 03:16:39 -04:00
Derrick Hammer 948d4d6109
fix: use call to getDefaultClientConfig to get chain config 2023-07-11 03:07:18 -04:00
Derrick Hammer 80fdc45ccd
fix: fix usage of deserializeSyncCommittee 2023-07-11 02:42:54 -04:00
Derrick Hammer a6759ec243
refactor: temp use js only bls 2023-07-11 02:33:28 -04:00
Derrick Hammer a5c01533fe
fix: return data property from update 2023-07-11 02:32:41 -04:00
Derrick Hammer 208ca03e80
refactor: expose subscribe on the base client, with optional callback and call on child clients 2023-07-11 02:21:30 -04:00
Derrick Hammer 67827c3776
fix: getConsensusOptimisticUpdate does not return 2023-07-11 01:54:01 -04:00
Derrick Hammer f8eba3644b
refactor: export getConsensusOptimisticUpdate and getCommitteeHash 2023-07-11 01:51:05 -04:00
Derrick Hammer efc657b790
refactor: move optimistic_update fetch logic to utility function 2023-07-11 01:50:42 -04:00
Derrick Hammer bfa5d227a0
fix: export RPC types 2023-07-11 01:35:41 -04:00
Derrick Hammer f24fdc5489
refactor: remove use of getExecutionFromBlockRoot in node client 2023-07-11 01:30:22 -04:00
Derrick Hammer 52aca21b78
fix: add missing methods to IStore interface 2023-07-11 01:09:50 -04:00
Derrick Hammer 3a48a52a53
fix: add getter for store in baseclient 2023-07-11 01:01:10 -04:00
Derrick Hammer a50271ec5b
fix: export all interfaces 2023-07-11 00:30:59 -04:00
Derrick Hammer 5d1bdec620
fix: export createDefaultClient 2023-07-11 00:15:54 -04:00
Derrick Hammer 5843acb79b
feat: Initial version 2023-07-10 16:47:50 -04:00