Skip to content

feat: support ic0.root_key #586

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

Draft
wants to merge 63 commits into
base: main
Choose a base branch
from
Draft

feat: support ic0.root_key #586

wants to merge 63 commits into from

Conversation

lwshang
Copy link
Contributor

@lwshang lwshang commented Apr 3, 2025

SDK-2058

Description

Update ic0 to include the new system API.

Add binding in api.rs module.

How Has This Been Tested?

The implementation of this new system API is still in a draft PR.
There is no ic releases containing this feature. The added e2e test is expected to fail.

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

lwshang and others added 30 commits June 17, 2024 21:16
* Add RejectionCode variant SysUnknown

* refactor: Call struct

* encode_args once

* update ic0 with new system API

* with_best_effort_response()

* doc comments

* safe wrapper for msg_deadline()

* refactor

* add e2e

* state machine script using git tag

* basic test pass

* configs after setting args

* call_and_forget

* minor improvements

* use recent beta dfx which has new system API

* clippy

* load.bash

* update candid-extractor

* fmt

* group methods in traits

* default to 10s timeout:wq

* prelude mod

* fmt
* ic0: handle 32/64-bits system API

* adjust safe bindings

* update safety notes

* Update call.rs

Co-authored-by: Adam Spofford <[email protected]>

---------

Co-authored-by: Adam Spofford <[email protected]>
* Add ic-cdk-management-canister crate

* move management canister code

* flat hierarchy and exclude candid-extractor

* exclude root Cargo.lock

* rm docs

* update workflows

* fmt

* fix doc

* cleanup examples.yml

* rm candid-extractor

* fix examples.yml

* fix cont.

* refactor e2e-tests

1:1 mapping of canisters to tests

* remove examples
…same name as the function itself (#525)

* add a test case to reveal the bug

* fix: update/query macro could not handle function arguments with the same name as the function itself

* changelog
* duplicate call.rs in crate root

* keep only the new call API in root call.rs

* CallResult<R> = Result<R, CallError>;

* RejectCode & CallPerformErrorCode

* remove CleanupExecuted

* try add CandidEncodeFailed error type

* handle CandidEncodeFailed error properly

* copy api/call.rs from main branch and fix for new ic0

* test all Call struct variants and rename ArgDecoderConfig to DecoderConfig

* specify CallPerformErrorCode variants
* e2e revails: Call without args fails

* fix and e2e call thoroughly

* move call internal items

* unify wording about cycles

* CallWithArg which allow non-tuple arg

* docs

* with_decoder_config instead of call_with_decoder_config

* rename: call -> call_tuple, call_and_forget -> call_oneway

* call() allows non-tuple return types
* wip

* pocket-ic must be in dev dependencies

* conditional compilation for wasm target_family

* cleanup

* CI wasm64

* fix ci.yml

* fix cont.

* no fail-fast

* rm e2e-tests/src/lib.rs
* deprecated annotations with note

* update ic-ledger-types

* RejectCode and CallPerformErrorCode have NoError variant

* ic-cdk-timers migrate to Call::new

* fix deprecation usage in async e2e

* fix doctests
…ode_with (#544)

* cleanup dfn_macro internal

* no arg decoding if function sig has no args

* name check

* decode_with: set custom arg decoder
* feat: safe binding for msg_deadline

* Option<NonZeroU64> for msg_deadline
* remove DecoderConfig from Call API

* deprecate note DecoderConfig

* PhantomData can be used for manual_reply

* deprecation note for ManualReply

* remove api_call.rs e2e test

* move is_recovering_from_trap to futures and re-export in lib.rs

* fix clippy

* deprecation note for the api/call module

* upgrade candid to 0.10.12
* Remove CandidEncodeFailed variant

* Unify RejectCode

* RejectCode doesn't include 0

* CallPerform also has a hard-coded reject message

* SystemError v.s. CallError

* avoid candid en/decoding in timers

* SystemError includes error_code

* Clarify 0 timeout for change_timeout()

* fix clippy

* simplify retry_later logic

* rename SystemError to CallRejected and make fields private

* fix typo

Co-authored-by: Eric Swanson <[email protected]>

---------

Co-authored-by: Eric Swanson <[email protected]>
* add back Unrecognized(u32) variant in RejectCode

* Clarify candid encoding fail and DRY

* update reject_message when sync failure

* mention msg_reject_msg for reject_message

* fix explicit target is redundant
* refactor: extract RejectCode into ic-response-codes

* refactor: extract the ic-management-canister-types crate
* with_arg takes ref

* SendableCall methods take &self

* empty bytes

* fix doctests

* upgrade candid to 0.10.13

* Simplify Call implementation

Get rid of the ConfigurableCall trait and the CallWithArg, CallWithArgs, and CallWithRawArgs structs.
Instead, we now have a single Call struct that can be configured and executed using chainable methods.

* fix lint

* remove prelude mod
* draft 1

* state machine futures

* Use Arc for userdata instead of Weak

* Switch to `Wake`

* fix logging

* draft (bad)

* clippy

* pesky bugs

* Distinguish between query and update contexts

* accidentally butchered this

* Docs

* further docs

* Fix export tests

* .

* Add test for channels

* Add docs warnings for this too
…with spec (#559)

* fixed typo

* test: add Candid equality test for ic-management-canister-types

* feat: add aux field in SignWithSchnorrArgs

* chore: bump to v0.2.0, changelog, explain correctness

* changelog include fix for NodeMetrics

---------

Co-authored-by: Linwei Shang <[email protected]>
* (un)bounded_wait ctors

* Call.await and Error types redesign

* test: collect call futures and join_all

* call mod doc and use Cow for encoded_args

* improve docs for errors

* add CallErrorExt trait and impl for errors

* update deprecation notes in api/call.rs

* clarify is_immediately_retryable and impls

* improve words

* doc: fix typos and apply review suggestions
hpeebles and others added 20 commits March 3, 2025 09:04
* upgrade pocket-ic and simplify code

* cache pocket-ic server binary

* cleanup gitignore

* rm scripts

* update ci.yml

* try fix ci

* fix cont.

* fix
* fix: only call `call_cycles_add128` if cycles amount > 0

* Reinstate

* Use `u128` rather than `Option<u128>`

---------

Co-authored-by: Linwei Shang <[email protected]>
* implement bitcoin_canister mod

* handle cycles payment

* prepare for e2e tests

* change arg to reference

* e2e test bitcoin methods

* DRY

* no _query methods

* add candid equality test

* pic_base and introduce subnets when required

* fix doc

* apply review suggestions
…codes (#571)

* switch to ic_error_types::RejectCode

* deprecate ic-response-codes
…der the hood (#570)

* update ic0 to include cost_* API

* add api bindings

* e2e test api bindings

* management_canister methods handles cycles under the hood

* changelog

* typo

* add Errors section in docs

* fill changelog

* distinguish api.rs bindings and management_canister.rs methods

* feat: Add higher level cost APIs  (#574)

* added high level endpoints to mgmt cost api

* add cost for performing call

* typo

* apply review suggestions

* improve cross reference in docs

* impl Into<u32> for curve and algo

* changelog

* lint suggests From trait

---------

Co-authored-by: michael-weigelt <[email protected]>
* update ic0 to include subnet_self*

* binding in api.rs

* e2e
* increase default timeout to 30s

* change management strategy of bounded

* bitcoin_canister bounded/unbouned

* default timeout to 300s

* sign_with_* unbounded

* bitcoin_get_* bounded

* doc alter

* expose methods for bitcoin canister_id & cycles

* doc bitcoin about alter

* fix doctests

* fix typos
* update ic.did

* add wasm_memory_threshold

* add memory_metrics

* bump to 0.3.0 and changelog
* add ic0.canister_liquid_cycle_balance128

* add binding in api.rs

* update root Cargo.toml dependency

* e2e test with updated pocket-ic

* fix e2e by make pocket-ic-server executable

* abort early with InsufficientLiquidCycleBalance

* e2e test

* flat the error types

* record more info in error

* fix doc links
* properly deprecate api/ submodules

* bump to alpha.2 and changelog

* update V18 guide

* ledger-types alpha.2
* custom encoder/decoder should be blob in Candid

* update V18 guide

* prost_build canister.proto

* references

* setup-protoc in CI
Base automatically changed from next to main April 22, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants