-
Notifications
You must be signed in to change notification settings - Fork 225
Historical JS endpoints #2285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Historical JS endpoints #2285
Conversation
src/apps/js_generic/js_generic.cpp
Outdated
auto kv_tx_id = tx.get_read_tx_id(); | ||
ccf::TxID tx_id; | ||
tx_id.view = static_cast<ccf::View>(kv_tx_id.term); | ||
tx_id.seqno = static_cast<ccf::SeqNo>(kv_tx_id.version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very annoying. I'm doing this so that I can to_str()
. The casts are needed as kv::TxId
uses signed, while ccf::TxID
uses unsigned ints.
letmaik/js-historical-endpoints@20552 aka 20210315.17 vs main ewma over 20 builds from 20148 to 20500 |
samples/apps/logging/js/app.json
Outdated
"execute_outside_consensus": "never", | ||
"authn_policies": ["jwt", "user_cert"], | ||
"historical": true, | ||
"readonly": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historical implies readonly, it would be elegant if the config reflected that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"mode": "readonly|writable|historical"
? Or were you thinking of something different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that'd be good. Paging @eddyashton for API input, but I think this would have the merit of ruling out historical: true, readonly: false and the validation and error that'd need to go with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think this is a tri-state enum. I like readonly
and historical
but not convinced by writable
. I think readwrite
is what we've used elsewhere (eg tx.rw
)? I could also go for canwrite
or maywrite
or just write
, but I think readwrite
is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readwrite
is fine. I'll do the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achamayou @eddyashton Done, please have a final look if the change looks good.
Looks good! Can the logging JS section in the doc and the changelog be expanded accordingly please? |
Co-authored-by: Amaury Chamayou <[email protected]>
There's only a C++ section for logging currently. Let's do docs in another PR. |
quickjs.enclave | ||
PUBLIC -nostdinc -DCONFIG_VERSION="${QUICKJS_VERSION}" -DEMSCRIPTEN | ||
-DCONFIG_STACK_CHECK | ||
PRIVATE $<$<CONFIG:Debug>:-DDUMP_LEAKS> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check, this is saying "when building this target in Debug, set DUMP_LEAKS", right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah
export type Proof = ProofElement[]; | ||
|
||
export interface Receipt { | ||
signature: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a jsdoc comments like /** base64-encoded signature of the root by the node identified by nodeId */, and if we did, would it get picked up by sphinx-js? Just wondering, not requesting :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and yes, see the CryptoKeyPair interface in #2313
No description provided.