feat: Endorsements Service#553
Conversation
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
Co-authored-by: Jakub Sztandera <oss@kubuxu.com>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Rod Vagg <rod@vagg.org>
rvagg
left a comment
There was a problem hiding this comment.
This all seems good to me; I'd like to have @hugomrdias's eyes on it though before merging, particularly for the synapse-core stuff.
There's also the comment about covering the fallback case in tests I wouldn't mind in here too.
| }, | ||
| }, | ||
| { | ||
| name: 'ProviderIdSet', |
There was a problem hiding this comment.
| name: 'ProviderIdSet', | |
| name: 'Endorsements', |
its called endorsements in other places
There was a problem hiding this comment.
The contract is called ProviderIdSet. Endorsements is-a ProviderIdSet.
There was a problem hiding this comment.
sure either way call it one of those everywhere.
address constant is called ENDORSEMENTS_ADDRESS_MAINNET
i prefer endorsements but im fine with whatever you think is best
There was a problem hiding this comment.
All of our other contracts were singletons but this one is not. We could have numerous ProviderIdSet for purposes besides endorsements; for example we could also use them for the approved SP list and deprecate the list currently living in FWSS. In the opposite direction, they can also be used for blacklisting or sanctions compliance.
hugomrdias
left a comment
There was a problem hiding this comment.
LGTM, just pending the naming thing and the awaits
| }, | ||
| }, | ||
| { | ||
| name: 'ProviderIdSet', |
There was a problem hiding this comment.
sure either way call it one of those everywhere.
address constant is called ENDORSEMENTS_ADDRESS_MAINNET
i prefer endorsements but im fine with whatever you think is best
|
The build failure is caused by merging master (which github does for approved PRs). I pulled the latest ABI changes in this PR, which is incompatible with #550 |
* Baseline super-good-enough cert Signed-off-by: Jakub Sztandera <oss@kubuxu.com> * stub decodeEndorsements * preferEndorsements * start decoding endorsements Signed-off-by: Jakub Sztandera <oss@kubuxu.com> * notAfter as timesetamp * encodeEndorsements * mv cert.ts to utils * utils export from cert.ts * fix test * test that createContexts prefers endorsements * encode/decode certs with domain separator * add cert test * add tools/endorse-sp.js * increase timeout for CI * make the decodeEndorsements a bit simpler Signed-off-by: Jakub Sztandera <oss@kubuxu.com> * add more tests Signed-off-by: Jakub Sztandera <oss@kubuxu.com> * Update packages/synapse-core/src/utils/cert.ts Co-authored-by: Jakub Sztandera <oss@kubuxu.com> * rm sinon * Update packages/synapse-core/src/utils/cert.ts Co-authored-by: Rod Vagg <rod@vagg.org> * cleanup * Update packages/synapse-core/src/utils/cert.ts Co-authored-by: Rod Vagg <rod@vagg.org> * disallow undefined chainId in decodeEndorsement * accept any of the preferred endorsements * remove certs * wagmi * constants * EndorsementsService * plumbing * import type * add endorsements mock and restore test * add endorsements script to examples/cli * delete keystore when init with pk * Revert "delete keystore when init with pk" This reverts commit c76237c. * fix lint * isCancel * serviceURL * lint * decodePDPCapabilities is not async * Revert "chore: re-add `getMaxProvingPeriod` and `challengeWindow` function (FilOzone#550)" This reverts commit 62bb92a. * getContract * test fallback on ping failure --------- Signed-off-by: Jakub Sztandera <oss@kubuxu.com> Co-authored-by: Jakub Sztandera <oss@kubuxu.com> Co-authored-by: Rod Vagg <rod@vagg.org>
Reviewer @rvagg @hugomrdias
Closes #540
Replaces #443
Changes
TODO multisig support for endorsement