-
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
Changes from 16 commits
2670a8d
131d002
51af321
36691fb
2367916
ef2a32a
7e81b60
3128aac
182b63d
c0a6703
d6a60be
a770975
b24dfc3
c9cd761
68add2f
472e457
1a02063
ee9e9a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,10 @@ if("sgx" IN_LIST COMPILE_TARGETS) | |
quickjs.enclave STATIC ${QUICKJS_SRC} ${CCF_DIR}/3rdparty/stub/time.c | ||
) | ||
target_compile_options( | ||
quickjs.enclave PUBLIC -nostdinc -DCONFIG_VERSION="${QUICKJS_VERSION}" | ||
-DEMSCRIPTEN -DCONFIG_STACK_CHECK | ||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yeah |
||
) | ||
target_link_libraries(quickjs.enclave PUBLIC ${OE_TARGET_LIBC}) | ||
set_property(TARGET quickjs.enclave PROPERTY POSITION_INDEPENDENT_CODE ON) | ||
|
@@ -40,7 +42,9 @@ endif() | |
|
||
add_library(quickjs.host STATIC ${QUICKJS_SRC}) | ||
target_compile_options( | ||
quickjs.host PUBLIC -DCONFIG_VERSION="${QUICKJS_VERSION}" | ||
quickjs.host | ||
PUBLIC -DCONFIG_VERSION="${QUICKJS_VERSION}" | ||
PRIVATE $<$<CONFIG:Debug>:-DDUMP_LEAKS> | ||
) | ||
add_san(quickjs.host) | ||
set_property(TARGET quickjs.host PROPERTY POSITION_INDEPENDENT_CODE ON) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,26 @@ export interface KVMap { | |
|
||
export type KVMaps = { [key: string]: KVMap }; | ||
|
||
export interface ProofElement { | ||
left?: string; | ||
right?: string; | ||
} | ||
|
||
export type Proof = ProofElement[]; | ||
|
||
export interface Receipt { | ||
signature: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yes and yes, see the CryptoKeyPair interface in #2313 |
||
root: string; | ||
proof: Proof; | ||
leaf: string; | ||
nodeId: string; | ||
} | ||
|
||
export interface HistoricalState { | ||
transactionId: string; | ||
receipt: Receipt; | ||
} | ||
|
||
interface WrapAlgoParams { | ||
name: string; | ||
} | ||
|
@@ -61,6 +81,11 @@ export interface AESKWPParams extends WrapAlgoParams { | |
name: "AES-KWP"; | ||
} | ||
|
||
export interface RsaOaepAESKWPParams extends WrapAlgoParams { | ||
letmaik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: "RSA-OAEP-AES-KWP"; | ||
label?: ArrayBuffer; | ||
} | ||
|
||
export interface CryptoKeyPair { | ||
privateKey: string; | ||
publicKey: string; | ||
|
@@ -80,6 +105,7 @@ export interface CCF { | |
): ArrayBuffer; | ||
|
||
kv: KVMaps; | ||
historicalState?: HistoricalState; | ||
} | ||
|
||
export const ccf = globalThis.ccf as CCF; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,30 @@ | |
"openapi": {} | ||
} | ||
}, | ||
"/log/private/historical": { | ||
"get": { | ||
"js_module": "logging.js", | ||
"js_function": "get_historical", | ||
"forwarding_required": "never", | ||
"execute_outside_consensus": "never", | ||
"authn_policies": ["jwt", "user_cert"], | ||
"historical": true, | ||
"readonly": true, | ||
"openapi": {} | ||
} | ||
}, | ||
"/log/private/historical_receipt": { | ||
"get": { | ||
"js_module": "logging.js", | ||
"js_function": "get_historical_with_receipt", | ||
"forwarding_required": "never", | ||
"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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think this is a tri-state enum. I like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
"openapi": {} | ||
} | ||
}, | ||
"/log/public": { | ||
"get": { | ||
"js_module": "logging.js", | ||
|
Uh oh!
There was an error while loading. Please reload this page.