-
Notifications
You must be signed in to change notification settings - Fork 137
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
Adds Protocol 20 (Soroban) support to the XDR and API. #538
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paulbellamy
force-pushed
the
soroban
branch
from
September 16, 2022 13:51
53387e7
to
cca969e
Compare
* Add FUTURENET network passphrase * Bump soroban package version
* Update xdr * Missed a few hash typeof shenanigans * don't need this export
* Add STANDALONE network passphrase * bump version
…ded (#557) * Default to include the contract code footprint, as that is always needed * 8.0.1-soroban.4
* Update xdr * Bump the packge version
* Missed removing parameters from the operation builder * Fix bug in contract.call footprint * Fixing up tests
* Correctly set `minAccountSequence` in `TransactionBuilder` for large values (#539) * Bump terser from 4.8.0 to 4.8.1 (#536) Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/commits) --- updated-dependencies: - dependency-name: terser dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Release v8.1.0 (#540) * Add support of CAP40 ed25519SignedPayload signer for SetOptionOp (#542) * Add TypeScript interfaces for Ed25519SignedPayload signers * Release v8.2.0 (#545) * Coalesce all xLM, Xlm, etc. => 'XLM' native asset code (#546) * Release v8.2.1 (#554) * make sure sodium is not an empty object in service workers (#567) * make sure sodium is not an empty object in service workers * Update CHANGELOG.md Co-authored-by: George <Shaptic@users.noreply.github.com> Co-authored-by: George <Shaptic@users.noreply.github.com> * use next xdr * First pass at invokeHostFunction * Fixing test & lint * Would help if we actually exported the Contract wrapper * the invokeHostFunctionOp should be useable with transaction builder * Add sandbox network passphrase * Push to the soroban tag for PRs to base branch (#547) * Fix github action to publish soroban tag (#548) * Have to update package.json to build the soroban tag (#549) * Add futurenet passphrase for soroban. (#550) * Add FUTURENET network passphrase * Bump soroban package version * Update soroban xdr (#552) * Update xdr * Missed a few hash typeof shenanigans * don't need this export * Bump soroban package version (#553) * Include standalone network passphrase (#555) * Add STANDALONE network passphrase * bump version * Default to include the contract code footprint, as that is always needed (#557) * Default to include the contract code footprint, as that is always needed * 8.0.1-soroban.4 * Update xdr to 026c9cd (#563) * Update xdr * Bump the packge version * New soroban xdr updates (#566) * Missed removing parameters from the operation builder * Fix bug in contract.call footprint * Fixing up tests * Soroban auth next updates (#570) * update xdr for auth-next * Add auth field to invokeHostFunctionOp * bump version * Needed to modify the generated code slightly * Fix lint --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Jun Luo <4catcode@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: George <Shaptic@users.noreply.github.com> Co-authored-by: OrbitLens <33724849+orbitlens@users.noreply.github.com> Co-authored-by: Piyal Basu <pbasu235@gmail.com>
@paulbellamy Apologies, I accidentally published a new version of this branch while trying to debug an issue in Freighter. It just created a new version Again, sorry about that. The automated pipeline worked a bit too well, it seems 😬 |
…ddresses (#572) * add strkey contract parsing * Add Address class to help parse & build ScAddresses * Add static constructors for account & contract addresses from bytes * bump version to release 8.2.2-soroban.9
* Update soroban xdr * bump version to release 8.2.2-soroban.10
…ures. (#576) * Attempting to add an error if you try to sign a transaction that needs contract signatures * Use the parent class' .operations --------- Co-authored-by: George Kudrayvtsev <george@stellar.org>
* Update xdr to add ContractAuth preimage nonce * bump version to 8.2.2-soroban.11
* Add Address.toBuffer method * need deep equal * Eugh. no buffer typeof on firefox.
* Update xdr for value overhaul * Fixing address & contract for new xdr * 8.2.2-soroban.12
* Unify isValidAmount errors to explain type reqs * Fixup tests to match new errors * Add changelog entry
* Linting fixup: yarn fmt
* Better falsy behavior and getters
…rseTokenAmount`) (#667)
) * Update to latest curr and next XDRs (testnet final) * Export curr instead of next! * Update codebase to match new XDR schemas: - function invocation now needs an InvokeContractArgs structure - signatureArgs was a 0-elem vec, now an ScVal w/ 0-elem vec - bodyType is gone - metaDataSizeBytes is gone - some minor test stuff has been tweaked for readability
* Amend GHA to push with `--tag beta` and not on Soroban merge --------- Co-authored-by: shawn <sreuland@users.noreply.github.com>
Shaptic
approved these changes
Sep 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a holistic view on the upstream merge. Here are the changelog / release notes:
v10.0.0-beta.0
: Protocol 20 SupportBreaking Changes
Node 16 is the new minimum version to use the SDKs.
Major XDR Changes
The XDR has been massively overhauled to support Soroban in Protocol 20, which means new operations, data structures, and a transaction format as well as new overlay features.
The core data structure of Soroban is a generic type called an
ScVal
(smart contract value, which is a union of types that can basically represent anything (numbers, strings, arrays, maps, contract bytecode, etc.). You should refer to the XDR for details, and you can rely some new APIs to make dealing with these complex values easier:nativeToScVal
helps convert native types to their closes Soroban equivalentscValToNative
helps find the closest native JavaScript type(s) corresponding to a smart contract valuescValToBigInt
helps convert numericScVal
s into nativebigint
sScInt
andXdrLargeInt
help convert to and frombigint
s to other types and form sized integer types for smart contract usageThe following are convenience methods for building out certain types of smart contract-related structures:
buildInvocationTree
andwalkInvocationTree
are both ways to visualize invocation calling trees betterauthorizeInvocation
helps multiple parties sign invocation calling treeshumanizeEvents
helps make diagnostic events more readableAdded
The following are new APIs to deal with new Soroban constructs:
Address
, which helps manage "smart" addresses in the Soroban context. Addresses there (used for auth and identity purposes) can either be contracts (strkeyC...
) or accounts (strkeyG...
). This abstraction helps manage them and distinguish between them easily.Contract
, which helps manage contract identifiers. The primary purpose is to build invocations of its methods via the genericcall(...)
, but it also provides utilities for converting to anAddress
or calculating its minimum footprint for state expiration.invokeHostFunction
for calling contract codebumpFootprintExpiration
for extending the state lifetime of Soroban datarestoreFootprint
for restoring expired, off-chain state back onto the ledgerTransactionBuilder
now takes asorobanData
parameter (and has a corresponding.setSorobanData()
builder method) which primarily describes the storage footprint of a Soroban (that is, which parts of the ledger state [in the form ofxdr.LedgerKey
s] it plans to read and write as part of the transaction).SorobanDataBuilder
factory to set fields individuallyTransactionBuilder
now has acloneFrom(tx, opts)
constructor method to create an instance from an existing transaction, also allowing parameter overrides viaopts
.