Rust environment for Stellar Jump Cannon.

Overview

rs-stellar-contract-env

Rust contract-environment interface and (optional) host implementation for Stellar Jump Cannon.

This crate contains elements of the shared environment-interface between smart contract guest and host: the Env trait that defines the set of available environment functions as well as the Val type that can pass back and forth through the WASM calling convention. Additionally small wrappers around subtypes of Val are included: Object, Symbol, Status, etc.

If configured with cfg(feature = "guest"), this crate contains the guest-side implementation of the environment interface dependent on extern fns provided by the host implementation. This can be used in a WASM runtime that provides the extern fns.

If configured with cfg(feature = "host"), this crate contains the host-side implementation of the environment interface. This can be used either in the real stellar-core host or for testing in the SDK.

Comments
  • Creating contracts

    Creating contracts "from contract" and "from ed25519" with "salt" is not intuitive

    The distinction between creating a contract from an ed25519 or a contract is not particularly relevant within the SDK. Contracts can only create contracts from contracts.

    I see the confusion here, but this logic is not correct. A contract can create a contract from an ed25519 if the ed25519 signature is passed to the contract as input. This functionality is actually a simple way to prevent ID-sniping in https://github.com/stellar/soroban-examples/issues/55. I'm not opposed to a rename, but this rename probably isn't the right one because it's unclear how the other variant would coexist.

    This PR also suggests that we probably aren't doing a good enough job explaining how existing functionality can be used. Maybe we should enumerate different possible scenarios and describe how the functions should be used in those scenarios. It's plausible this scheme can even be simplified... we came up with this quite early in the design process.

    Originally posted by @jonjove in https://github.com/stellar/rs-soroban-sdk/issues/454#issuecomment-1219540835

    +1

    This PR also suggests that we probably aren't doing a good enough job explaining how existing functionality can be used.

    I think it goes deeper than a missing explanation. The way that we are framing contract creation irrespective of documentation is not intuitive.

    For example, the terms _from_contract and _from_ed25519 are confusing. It is easy to arrive at multiple definitions for what it can mean to be "from" one of these things. When using an ed25519 public key to create, you point out that we can create "with ed25519 from a contract," so the "from contract" applies to both.

    The term salt is also ambiguous. While I agree we are technically using the term correctly, it isn't intuitive, and its name doesn't communicate important properties of its value, such as its uniqueness in the scope of the contract or ed25519.

    I think we need to find some better term to define the "identifier", or "sub-identifier", which is currently the "salt". And a better term to define the "scope" of uniqueness that the identifier applies within, which is either a contract or an ed25519.

    Originally posted by @leighmcculloch in https://github.com/stellar/rs-soroban-sdk/pull/454#issuecomment-1220221873

    @jonjove @sisuresh @tomerweller

    opened by leighmcculloch 19
  • Initial sketch 160-bit (32+128) RawVal

    Initial sketch 160-bit (32+128) RawVal

    This is a not-totally-sketch sketch of a fairly major (though not especially user-visible) change to RawVal. I'm opening it here for discussion, not as a definite proposal but because it's at the point where a decent number of tests are actually passing and it's worth discussing before either forging ahead or abandoning.

    Background

    RawVal is the "polymorphic" type used to carry values that can be one-of-many-types -- numbers, object handles, symbols, booleans, errors -- back and forth between the (native) host and the (WASM) guest. It's used for passing arguments to contracts, as well as storing values in our host-side polymorphic containers (maps and vecs). It's currently bit-packed into a 64-bit value, because .. WASM only really knows about values that are 32 or 64 bits. Everything else you have to tell it about fairly manually.

    Users don't directly see RawVal very often, they usually see a wrapper type around it that imbues it with a bit more knowledge of its content. But RawVals are fairly ubiquitous under the covers of the system, and a lot of the WASM bytecode we generate is concerned with packing, unpacking, tag-testing and converting them.

    Summary of changes:

    • RawVal is changed to a 160-bit value: a pair of u32 + u128

      • The u32 is a control word, which holds the type-tag and any other metadata
      • The u128 is the payload word, which holds the non-metadata content of the value
    • A pile of new code is added to call and return plumbing to "explode" and "implode" RawVals to and from multiple-argument sets -- sequences of u32 and u64 values that WASM supports -- and do returns via caller-allocated return-pointers, and similar messiness because there's no stable and widely-supported ABI in WASM that we can rely on for passing multi-word values between the host and guest yet. We're essentially hand-implementing an ABI.

    • Some of this code is in the SDK, and there's a companion branch for it that's required for this to work.

    • The "wrapper" types around RawVal -- used when we know the subtype of value carried in a RawVal, such as when we have a u32 or Object handle -- are instead turned into "subset" types that only carry the bits relevant to them, don't carry a whole RawVal at all anymore (though they can reconstruct one on demand if needed).

      • Object for example is Object(u64), Status is Status(u64), Symbol is Symbol(u128), and so on.
      • This allows passing and returning such "subset" types without engaging the big-expensive-RawVal ABI
      • Actually quite a lot of host functions take Object and u32 args, not RawVal. Only polymorphic functions like vec_get which can return "anything" (because vector-contents are polymorphic) need to return RawVal.

    Rationale

    Why consider this? A few reasons:

    1. It lets us raise the size of Symbol from 10 characters to 21 characters. Users are chafing with 10 chars a bit.
    2. It eliminates the "weird" number situation in the existing encoding, where "u63" fits (but what's that?) and u64 and i64 have to be boxed as Objects. All normal Rust scalar types fit unboxed into this experiment's large RawVals, including i128 and u128.
    3. It supports standardizing on an unboxed i128 as a ubiquitous fixed-point arithmetic type for asset values. Currently we are somewhat on the fence about how people are likely to be representing asset-amounts. It's possible that u63 and/or boxed i64 values will be the norm (possibly using the Stellar-native scale factor of 7 digits -- it's quite a decent range) but it's also fairly likely that people coming from Ethereum or other ecosystems will be expecting bigger "standard" number types for asset-amounts, and will wind up using BigInt everywhere (or rolling their own on top of Bytes) if we don't provide something standard.
    4. Given the luxuriously-sized i128, it might support elimination of BigInt from the object repertoire entirely, which is somewhat overkill for use-cases that would be ok with i128, and a bit tricky to instrument safely / correctly for gas-metering.

    Impacts

    • Broadly speaking, it seems to work. There remain some bugs.
    • Codesize goes up, but not horribly. Worst cases double, average cases that are heavy on host functions with mostly "subset"-typed arguments are more like 10-40% overhead.

    | before |after | contract | | -------- | ----- | ----------- | |6522 | 8840 | soroban_auth_advanced_contract.wasm |996 | 1534 | soroban_auth_contract.wasm |456 | 412 | soroban_cross_contract_a_contract.wasm |903 | 665 | soroban_cross_contract_b_contract.wasm |1015 | 1558 | soroban_custom_types_contract.wasm |963 | 638 | soroban_deployer_contract.wasm |424 | 539 | soroban_deployer_test_contract.wasm |509 | 616 | soroban_errors_contract.wasm |566 | 730 | soroban_events_contract.wasm |409 | 461 | soroban_hello_world_contract.wasm |425 | 510 | soroban_increment_contract.wasm |7478 | 10614 | soroban_liquidity_pool_contract.wasm |21638 | 31565 | soroban_liquidity_pool_router_contract.wasm |283 | 262 | soroban_logging_contract.wasm |11897 | 17271 | soroban_single_offer_contract.wasm |11497 | 16377 | soroban_single_offer_contract_xfer_from.wasm |21451 | 31040 | soroban_single_offer_router_contract.wasm |4655 | 7872 | soroban_timelock_contract.wasm |31481 | 31481 | soroban_token_contract.wasm |11405 | 17020 | soroban_wallet_contract.wasm

    Discussion

    I do not know exactly what to make of this. Knowing it's possible is interesting, but it's also fairly costly and the benefits might not justify it. I am interested in hearing input from others, especially around the question of number types.

    The way I see it we have 3-and-a-half options:

    1. Stick with current, encourage use of u63 for asset-amounts (which are almost always positive), assume scale=7 is good enough. It seems to have been basically ok for the classic Stellar protocol, though we occasionally need support routines that minimize intermediate rounding, like a 3-arg A*B/C operation conducted in 128-bit precision. We can absolutely build that sort of thing into the SDK and/or host functions though. 1.1. Possiby encourage using BigInt for asset-amounts, and possibly shift BigInt to a type with a menu of of fixed-size-but-big types, like u128, u256, u512 and u1024, such as supported by the crypto_bigint library. This has a more predictable cost model and range (eg. one can know that if you are working in u256 that your type will convert back to an Ethereum value too). Though it also lacks a few functions in our existing BigInt such as pow.
    2. Move to this experiment, wire in (say) scale=18 which is the norm (and in the past suggested mandatory-value) in ERC-20, and certainly plenty for any real use-cases. We get more "breathing room" in our value repertoire, and a slightly simpler mental model for users, at the expense of code size (and thus performance).
    3. Move to an even-larger version of this experiment, say with RawVal payload being 256 bits. This is a bit of an appealing target as well, in some ways, since it's both "ridiculously huge for fixed-point math", and "interoperates exactly with Ethereum values", and also "is able to store SHA256 outputs and Ed25519 points as unboxed values". But since those latter two tend to be opaque constants rather than number-like values with lots of temporaries created and forgotten through arithmetic expressions, the value of keeping them unboxed is not totally clear to me.

    One thing to recognize is that no matter what we put in as "standard" types (i.e. with pre-defined tags in the XDR, standard helper routines for printing and converting, standard operations as host functions), users can always "ship their own" in a contract. They can include fixed-point arithmetic or unboxed u256 values or whatever. It'll just be a bit janky -- slower than native-supported, non-interoperable, harder to debug, hurt their codesize, etc. -- but they can do it. So we don't need to cover all corner cases. We need to do something good-enough that most contracts have something familiar to reach for.

    Personally I am .. somewhat disappointed in the cost and complexity of this experiment and am leaning towards options 1 or 1.1 above -- stay where we are and encourage either u63/i64 or a specific size of Object-handle based BigInt for normal asset values, with a menu of BigInt options for interop -- but I would love to hear others' opinions. Especially those working on "standard token contract interfaces" -- we probably want to smooth down those interfaces, make the type repertoire support their needs directly.

    opened by graydon 14
  • Add host function for aborting current subtransaction with details / a status code

    Add host function for aborting current subtransaction with details / a status code

    ~~We need a way for a contract to exit the subtransaction / call that it's currently running immediately, without popping / returning all the way back out to its outermost frame. The moral equivalent of the exit(int) standard library function in C.~~

    ~~Pass void for success, or a status for failure -- or just a status if we're going to keep the "ok" / "success" status code (this might be the exception to the "never pass a status" rule).~~

    We should allow aborting the current subtransaction with some details -- eg. calling env.abort(status) -- rather than just calling panic!(). This might include revising the status type to include a variant that denotes its file name / line number / a user-provided message as in #205.

    enhancement hostfunction 
    opened by graydon 12
  • Add STATIC_NONE static type for use with Optional<T>

    Add STATIC_NONE static type for use with Optional

    Add STATIC_NONE static type for use with Option<T>.

    The static type needs extending to include a STATIC_NONE value.

    The value will be used by the Option<T> when a type can be stored as a type or a STATIC_NONE.

    Related discussion: https://discord.com/channels/897514728459468821/982314893237714967

    enhancement 
    opened by leighmcculloch 11
  • Support Native Contracts

    Support Native Contracts

    What problem does your feature solve?

    CAP-54 describes a native contract, but we don't have any support for this yet.

    What would you like to see?

    Support for native contracts.

    What alternatives are there?

    None.

    opened by jonjove 10
  • Make built-in token's classic account auth more in line with the Core

    Make built-in token's classic account auth more in line with the Core

    What

    • Limit the signature count (in core the limit is in XDR)
    • Limit the weight to be not more than 255 (as thresholds are u8)

    Why

    Make this consistent with what we do in Core, modulo non-Ed25519 signers.

    Known limitations

    N/A

    opened by dmkozh 9
  • Add missing host functions related to ledger header information

    Add missing host functions related to ledger header information

    Gaps:

    • needed to write any kind of conditional based on "time"
      • ledger number
      • ledger close time
    • needed to deal with core protocol ("host version") upgrades
      • protocol version
    hostfunction 
    opened by MonsieurNicolas 9
  • Improved built-in token error reporting.

    Improved built-in token error reporting.

    What

    Instead of returning a generic error, the contract returns more specific status code and creates a debug event.

    This is the first shot at the error names; I'm open to suggestions on names and scope of the error types.

    Why

    Improving the developer experience (https://github.com/stellar/rs-soroban-env/issues/526)

    Known limitations

    Not updating the tests now, given that https://github.com/stellar/rs-soroban-env/pull/525 that adds a lot of error scenarios is still not merged.

    opened by dmkozh 8
  • Revise Status to better support diagnostic-information-vs-error-handling split.

    Revise Status to better support diagnostic-information-vs-error-handling split.

    Currently the Status type reuses a major/minor structure that we also use for object index/type pairs: a 28 bit status-type and a 32 bit status-code.

    This is plausible, but it's also not necessarily the best representation of Status values, and we've been feeling a lot of pressure to pack more information into Status values in at least a few places:

    • Conversion errors want to pack at least a from-type and to-type into a status value.
    • Debug / trace logging would benefit from packing some or all of a file name, line number and user-provided static string into a status.
    • User-specified abort Statuses (as in #146) could also benefit from these things.

    I'm thinking it might be nice to decompose the 60 bits available to Status values a little differently. For example: assuming WASM binaries in the current design are capped at 64KB, we can assume any linear-memory address (such as those for string constants) fits in 16 bits. Even if we are being more future-proof-y and saying 1MB / 20 bits, we could easily do a 4-field split: 4 bit type, 16 bit code-or-line-number, and 2 20-bit string constants (for filename and user message). Or keep the type space a bit bigger, stick with 64k for addresses, and go 12-16-16-16. Or go with 256KB / 18 bit addresses, and do 8-16-18-18.

    We might even be able to figure out a way to build a 1-level indirection table for string constants -- we really only care about the start positions, not all the sub-positions within them -- so we can denote the start positions by table index rather than resolved address, and drop to (say) 10 bit indexes -- not likely anyone will have a contract with more than 1024 files.

    (We could also do something even more elaborate and add a status object type, maybe that we overflow to, but I don't know if that'd be any better.)

    opened by graydon 8
  • Add token events

    Add token events

    What

    Resolves https://github.com/stellar/rs-soroban-env/issues/455

    Why

    [TODO: Why this change is being made. Include any context required to understand the why.]

    Known limitations

    Need to add some test after https://github.com/stellar/rs-soroban-env/pull/487 is merged.

    opened by jayz22 7
  • Support DebugEvents in WASM builds

    Support DebugEvents in WASM builds

    The SDK provides logging functionality that is only available in debug builds. That logging functionality creates DebugEvents by calling this function:

    • log_static_fmt_general

    That function isn't implemented for the Guest Env though, so when a contract is built using the dev profile the debug events are lost.

    We should add support for debug events so that contract developers can see debug events / logs when using the CLI tool or when contract importing a dev profile built contract for testing.

    opened by leighmcculloch 7
  • Cleanup Stellar Asset Contract creation

    Cleanup Stellar Asset Contract creation

    Now that the built-in Soroban token has been removed, the only valid ContractId for ScContractCode::Token is ContractId::Asset. If a user tries to create the Stellar Asset Contract with ContractId::SourceAccount or ContractId::Ed25519PublicKey, a contract will be created, but it will be unusable because init_asset won't and can't be called on the contract (because init_asset verifies the contractId was derived from the Asset being initialized). Note that this issue cannot be used maliciously.

    We should clean this up. At a minimum, return an error if the incorrect ContractId type is seen with ScContractCode::Token, and we should consider updating the xdr to make this scenario impossible.

    opened by sisuresh 0
  • (Budget metering) Add cost tiers to wasmi instructions

    (Budget metering) Add cost tiers to wasmi instructions

    Based on results from https://github.com/stellar/rs-soroban-env/pull/597, we need to account for different costs of wasmi instructions in the host metering.

    • To break down different wasmi instructions to several tiers, and assign a unit cost to each tier.
    • Account for the unit cost in the buffered step meter.
    • Expose the wasmi cost tier parameters as new Budget::CostTypes.
    opened by jayz22 0
  • Calibration code should be run as part of the GitHub workflow for PRs

    Calibration code should be run as part of the GitHub workflow for PRs

    Calibration code is currently not triggered in either local make all or as part of the GH workflow for PR validation. It needs to be run explicitly via cargo bench. It can go stale very easily. We should make a "lightweight" calibration workflow just to validate the code still runs.

    opened by jayz22 0
  • Charge comparison of `FixedSizeOrdType` an amount corresponding to its type.

    Charge comparison of `FixedSizeOrdType` an amount corresponding to its type.

    In https://github.com/stellar/rs-soroban-env/blob/a7843346bf2db743291aca6575ec82f6a5e7f1a3/soroban-env-host/src/host/comparison.rs#LL100C31-L100C31 We are charging 1 for all types. Ideally this should be mem::size_of<T> but this interface is not stable and we can't use it. Instead, we should pass the size of the structure, if it's known for the type, or an upper bound size into the macro, and charge the corresponding amount to the budget.

    opened by jayz22 0
  • Possibly split BytesClone into two cost types

    Possibly split BytesClone into two cost types

    In https://github.com/stellar/rs-soroban-env/pull/585 there's a TODO in metered_clone.rs about possibly splitting BytesClone into two separate costs: one for allocating heap space for a new block-of-bytes, and a separate cost for doing a shallow-copy of data into the new block-of-bytes.

    This TODO derives from two facts:

    1. The change splits (in several places, eg. also in metered_vector) the costs of allocation from the costs of cloning. This is because we wish to charge for cloning in bulk when doing shallow clones, rather than charging one-by-one. In the best case, both charging and cloning will happen in bulk (i.e. cloning will just be a single call to memcpy).
    2. the fact that we're overloading the use of BytesClone here in the first place -- it was originally designed just to track the cost of duplicating a Bytes host object -- and maybe a better thing to do here is to make a separate, dedicated cost called ShallowClone that represents the cost of cloning "something shallow" without the cost of allocation.
    bug 
    opened by graydon 0
Releases(v0.0.11)
  • v0.0.11(Dec 8, 2022)

    What's Changed

    • Upgrade crate-git-revision to 0.0.4 by @brson in https://github.com/stellar/rs-soroban-env/pull/598
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/601
    • Bump version to 0.0.11 by @github-actions in https://github.com/stellar/rs-soroban-env/pull/602

    New Contributors

    • @brson made their first contribution in https://github.com/stellar/rs-soroban-env/pull/598

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.10...v0.0.11

    Source code(tar.gz)
    Source code(zip)
  • v0.0.10(Dec 1, 2022)

    What's Changed

    • Fix build by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/564
    • Update rust-version by @github-actions in https://github.com/stellar/rs-soroban-env/pull/562
    • Add Host::with_artificial_test_contract_frame by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/565
    • Lean on workspace inheritance for deps for development by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/568
    • Use the current SDK version for test WASMs. by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/571
    • Restructure benchmark framework, add calibration code for all CostTypes. by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/561
    • Disable budget costs for object cmp by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/580
    • Env changes to decouple contract instance from source (CAP-46-02) by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/572
    • Remove BigInt, switch everything to {ui}128. by @graydon in https://github.com/stellar/rs-soroban-env/pull/581
    • Add VERSION to the env crates by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/588
    • Loosen serde requirement by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/589
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/590
    • Update soroban-wasmi by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/591
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/593
    • Bump version to v0.0.10 by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/594

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.9...v0.0.10

    Source code(tar.gz)
    Source code(zip)
  • v0.0.9(Nov 3, 2022)

    What's Changed

    • Disable default-features on stellar-xdr workspace dependency by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/559
    • Bump version to 0.0.9 by @github-actions in https://github.com/stellar/rs-soroban-env/pull/560

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.8...v0.0.9

    Source code(tar.gz)
    Source code(zip)
  • v0.0.8(Nov 3, 2022)

    What's Changed

    • Fix loan stellar-xdr 0.0.6 version stuck in the past by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/557
    • Bump version to 0.0.8 by @github-actions in https://github.com/stellar/rs-soroban-env/pull/558

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.7...v0.0.8

    Source code(tar.gz)
    Source code(zip)
  • v0.0.7(Nov 2, 2022)

    What's Changed

    • Metered host object cmp by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/527
    • Added more test coverage for built-in token. by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/525
    • Add initial "hostile contract" and unit test calling it by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/521
    • Vm tuning by @graydon in https://github.com/stellar/rs-soroban-env/pull/529
    • Update stellar-xdr and get BytesM/StringM by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/536
    • Overhaul calibration benchmarks by @graydon in https://github.com/stellar/rs-soroban-env/pull/539
    • Add token events by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/523
    • Update CODEOWNERS by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/540
    • Correct / tidy up / comment calibration code. by @graydon in https://github.com/stellar/rs-soroban-env/pull/542
    • Synth wasm by @graydon in https://github.com/stellar/rs-soroban-env/pull/546
    • Catch panics from native contracts in try_call, fix #430 by @graydon in https://github.com/stellar/rs-soroban-env/pull/548
    • Improved built-in token error reporting. by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/532
    • Add missing conversion from Status->ScStatus for the ContractError variant by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/550
    • Use stellar/binaries for binary installs by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/551
    • Capture user panic-strings in native builds, avoid spurious NoContractRunning error by @graydon in https://github.com/stellar/rs-soroban-env/pull/552
    • Few small fixes to error debug events by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/553
    • Bug 554 - fix stack overflow by @graydon in https://github.com/stellar/rs-soroban-env/pull/555
    • Bump version to 0.0.7 by @github-actions in https://github.com/stellar/rs-soroban-env/pull/556

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.6...v0.0.7

    Source code(tar.gz)
    Source code(zip)
  • v0.0.6(Oct 6, 2022)

    What's Changed

    • Add release documentation by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/421
    • Migrate to wasmi_v1 API by @graydon in https://github.com/stellar/rs-soroban-env/pull/422
    • Move the OK, UNKNOWN_ERROR consts into Symbol by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/424
    • Native token contract wrapper interface by @jonjove in https://github.com/stellar/rs-soroban-env/pull/338
    • Add invocation error debug event to call like try_call by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/427
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/429
    • Add RawVal conversions for Result<> by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/431
    • Use ConversionError for Symbol<->ScVal by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/432
    • Add ScVal -> RawVal conversion without ref by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/433
    • Remove Hash and PublicKey from objects by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/436
    • Fix names of variants in Result conversion to RawVal by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/437
    • Add RawVal <> String conversions for tests by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/439
    • Allow some &str RawVal conversions in non-std builds by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/440
    • Add tuple to [RawVal; N] conversions by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/441
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/450
    • Remove legacy placeholder-free "format strings" on debug events that mask arguments by @graydon in https://github.com/stellar/rs-soroban-env/pull/448
    • Add comments to each CostType; add very crude, untested model parameters by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/443
    • Change the encoding of Result to only support Status as errpr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/449
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/452
    • interpret status-return as an error and roll back frame, fix #453 by @graydon in https://github.com/stellar/rs-soroban-env/pull/454
    • Add fail_with_status host function, fix #146 by @graydon in https://github.com/stellar/rs-soroban-env/pull/425
    • Add missing TryIntoVal<_, RawVal> for RawVal conversion by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/457
    • Change EnvBase functions to not panic, fix #434 by @graydon in https://github.com/stellar/rs-soroban-env/pull/458
    • Fixes to built-in token to_smart`to_classic` methods by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/459
    • Update xdr to success result by @graydon in https://github.com/stellar/rs-soroban-env/pull/461
    • Remove panic!s from builtin contract. by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/460
    • Fix metering to actually work, add run_contract bin by @graydon in https://github.com/stellar/rs-soroban-env/pull/465
    • Support logging debug events via the guest interface by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/464
    • Add with_mutable_ledger_info by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/467
    • Update rust-version by @github-actions in https://github.com/stellar/rs-soroban-env/pull/474
    • Add function to create token wrappers by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/475
    • Source Account Auth: Add getting source type and source account by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/473
    • Built-in token: use proper identifier for account nonce. by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/480
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/482
    • Update soroban-spec dep by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/481
    • update xdr by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/483
    • Fix get_invoker_type by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/486
    • Add docs for the create_contract_from_source_account host fn by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/488
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/489
    • Use AccountId instead of Bytes for account ids by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/490
    • Add host function for creating token from source account and plumb both token host functions into invoke_function_raw by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/492
    • Add get_ledger_network_id host fn by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/496
    • Disable the create_contract_from_ed25519 host fn by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/497
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/499
    • Use from_xdr instead of read_xdr for slice decoding by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/501
    • Fix sponsorship handling in transfer_account_balance. by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/504
    • Add metering for AccountId and ContractCode by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/505
    • Update public types by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/495
    • Organize with_mut_storage, with_ledger_info by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/508
    • Check all built-in token ops to have non-negative amounts. by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/506
    • Add budget metering for the native token contract by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/507
    • Make built-in token's classic account auth more in line with the Core by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/493
    • Remove wrap by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/511
    • Cleanup, consolidate metering for read/write_xdr by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/510
    • Use import and export instead of to_smart and to_classic by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/514
    • Add ScVal try_into_val RawVal by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/517
    • Always return Account if there's only one frame by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/519
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/518
    • Forbid contract reentry by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/513
    • Reduce the amount of roundtrips for built-in token contract by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/515
    • Respect trustline limit in to_classic conversions by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/516
    • Add a slightly complex wasm testcase by @graydon in https://github.com/stellar/rs-soroban-env/pull/524
    • Smoke tests & test utils for built-in token by @dmkozh in https://github.com/stellar/rs-soroban-env/pull/487
    • Remove run_contract bin by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/531
    • Bump version to 0.0.6 by @github-actions in https://github.com/stellar/rs-soroban-env/pull/530

    New Contributors

    • @dmkozh made their first contribution in https://github.com/stellar/rs-soroban-env/pull/459

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.5...v0.0.6

    Source code(tar.gz)
    Source code(zip)
  • v0.0.5(Sep 9, 2022)

    What's Changed

    • Minor fixes by @graydon in https://github.com/stellar/rs-soroban-env/pull/402
    • regenerate test vectors for 0.0.4 by @graydon in https://github.com/stellar/rs-soroban-env/pull/403
    • Add get_current_call_stack by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/376
    • Improve CI cache by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/407
    • network_id to network_passphrase by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/408
    • use updated sdk by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/410
    • Set the target-dir for cargo installs by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/411
    • Reorder cargo install options to match other repos by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/412
    • Fix map_keys and map_values by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/413
    • Dry run publish release/ branches by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/414
    • Fix branch of workplace publish dry run action by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/415
    • Separate the publish workflows and use new versions by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/416
    • Move publish workflow to separate workflow by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/418
    • Bump version to 0.0.5 by @github-actions in https://github.com/stellar/rs-soroban-env/pull/419

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.4...v0.0.5

    Source code(tar.gz)
    Source code(zip)
  • v0.0.4(Aug 31, 2022)

    What's Changed

    • Revert "Revert "Refactor index validity-checking code into a new file "" by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/294
    • Set default budget limits to unlimited by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/297
    • Add build cache in ci by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/298
    • Fix complete ci job by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/300
    • Update cargo-hack used in ci by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/301
    • Add CODEOWNERS by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/304
    • Clean up host storage/data related code by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/299
    • Fix charge_mem to charge CostType::WasmMemAlloc, close #295 by @graydon in https://github.com/stellar/rs-soroban-env/pull/306
    • More clean-up on contract data and storage-related by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/309
    • Replace FrameGuard drop trait with guarded closure; add metering by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/313
    • Fix ci complete job (again) by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/318
    • Add metering to Val conversions, host function invocation by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/315
    • Support calibration benches on apple silicon macs by @graydon in https://github.com/stellar/rs-soroban-env/pull/320
    • Add ci workflow to set min rust-version by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/321
    • Switch mac calibration to older and more portable rusage_info_v4 by @graydon in https://github.com/stellar/rs-soroban-env/pull/326
    • Native token by @jonjove in https://github.com/stellar/rs-soroban-env/pull/319
    • Update rust-version by @github-actions in https://github.com/stellar/rs-soroban-env/pull/327
    • Add ledger info host functions by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/330
    • Update rust-version by @github-actions in https://github.com/stellar/rs-soroban-env/pull/333
    • Add Host::register_test_contract_wasm by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/332
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/337
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/340
    • Remove u8 as a RawVal by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/343
    • Add conversions between RawVal and [u8; N] by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/344
    • Expose LedgerInfo by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/350
    • Expose LedgerInfo only with testutils by @sisuresh in https://github.com/stellar/rs-soroban-env/pull/351
    • Add Display impl to Symbol::Error by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/349
    • Add panic! messages to Symbol::from_str panics by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/352
    • Support contract events by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/342
    • Move WASM tests and inputs to env repo, fix #329 by @graydon in https://github.com/stellar/rs-soroban-env/pull/354
    • Update rust-version by @github-actions in https://github.com/stellar/rs-soroban-env/pull/355
    • Add conversion from Infallible to ConversionError by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/356
    • Clarify comment about meta version, fix #328 by @graydon in https://github.com/stellar/rs-soroban-env/pull/358
    • Replace TryFrom<EnvVal<>> with TryFromVal<> by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/357
    • More commentary on when and how to regenerate WASM tests by @graydon in https://github.com/stellar/rs-soroban-env/pull/361
    • trim deps by @graydon in https://github.com/stellar/rs-soroban-env/pull/249
    • Add contract data wasm by @graydon in https://github.com/stellar/rs-soroban-env/pull/365
    • Actually surface the contract_data.wasm as a constant by @graydon in https://github.com/stellar/rs-soroban-env/pull/366
    • Undo cyclic dev-dependency that is confusing rust-analyzer by @graydon in https://github.com/stellar/rs-soroban-env/pull/367
    • Flesh out support for ContractCode, Hash and PublicKey. by @graydon in https://github.com/stellar/rs-soroban-env/pull/368
    • Check if rust-analyzer can parse project by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/371
    • Update to rs-stellar-xdr@925dcea0 by @graydon in https://github.com/stellar/rs-soroban-env/pull/374
    • Host budget metering by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/307
    • Add base64 feature to xdr import by @paulbellamy in https://github.com/stellar/rs-soroban-env/pull/375
    • Update .wasm path in the workflow by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/377
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/378
    • Add hostfns to construct BigInt from bytes/array of digits by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/380
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/381
    • Add RawVal consts for i32/u32 one, neg one, min, max by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/382
    • Add hostfn account_exists. by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/383
    • Add conversions from ref types to RawVal by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/384
    • Add conversions from ref types to RawVal by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/385
    • Add FromVal by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/386
    • Add hostfns to find an element in a vec by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/387
    • Add vec_push_front and vec_push_back by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/388
    • Rename "Binary"("binary", "bin", "binaries" etc) to "Bytes" by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/389
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/390
    • Update stellar-xdr by @leighmcculloch in https://github.com/stellar/rs-soroban-env/pull/391
    • Remove bigint_cmp and fix create contract test. by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/392
    • Update test-wasms dependencies by @jayz22 in https://github.com/stellar/rs-soroban-env/pull/393
    • Make token auth match soroban-sdk-auth by @jonjove in https://github.com/stellar/rs-soroban-env/pull/394
    • Native token cleanup by @jonjove in https://github.com/stellar/rs-soroban-env/pull/397
    • Release automation by @graydon in https://github.com/stellar/rs-soroban-env/pull/398
    • Bump version to 0.0.4 by @github-actions in https://github.com/stellar/rs-soroban-env/pull/399
    • Bump stellar-xdr dep to 0.0.2 by @graydon in https://github.com/stellar/rs-soroban-env/pull/400

    New Contributors

    • @github-actions made their first contribution in https://github.com/stellar/rs-soroban-env/pull/327
    • @paulbellamy made their first contribution in https://github.com/stellar/rs-soroban-env/pull/375

    Full Changelog: https://github.com/stellar/rs-soroban-env/compare/v0.0.3...v0.0.4

    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Jul 29, 2022)

  • v0.0.2(Jul 29, 2022)

Owner
Stellar
Stellar
A cargo subcommand to fetch the $OUT_DIR environment variable from build scripts

cargo-outdir A cargo subcommand to fetch the $OUT_DIR variable from build scripts. This is extremely useful to inspect the output of automatically gen

null 2 Sep 29, 2022
Leetcode Solutions in Rust, Advent of Code Solutions in Rust and more

RUST GYM Rust Solutions Leetcode Solutions in Rust AdventOfCode Solutions in Rust This project demostrates how to create Data Structures and to implem

Larry Fantasy 635 Jan 3, 2023
Simple autoclicker written in Rust, to learn the Rust language.

RClicker is an autoclicker written in Rust, written to learn more about the Rust programming language. RClicker was was written by me to learn more ab

null 7 Nov 15, 2022
Rust programs written entirely in Rust

mustang Programs written entirely in Rust Mustang is a system for building programs built entirely in Rust, meaning they do not depend on any part of

Dan Gohman 561 Dec 26, 2022
Rust 核心库和标准库的源码级中文翻译,可作为 IDE 工具的智能提示 (Rust core library and standard library translation. can be used as IntelliSense for IDE tools)

Rust 标准库中文版 这是翻译 Rust 库 的地方, 相关源代码来自于 https://github.com/rust-lang/rust。 如果您不会说英语,那么拥有使用中文的文档至关重要,即使您会说英语,使用母语也仍然能让您感到愉快。Rust 标准库是高质量的,不管是新手还是老手,都可以从中

wtklbm 493 Jan 4, 2023
A library for extracting #[no_mangle] pub extern "C" functions (https://docs.rust-embedded.org/book/interoperability/rust-with-c.html#no_mangle)

A library for extracting #[no_mangle] pub extern "C" functions In order to expose a function with C binary interface for interoperability with other p

Dmitrii - Demenev 0 Feb 17, 2022
clone of grep cli written in Rust. From Chapter 12 of the Rust Programming Language book

minigrep is a clone of the grep cli in rust Minigrep will find a query string in a file. To test it out, clone the project and run cargo run body poem

Raunak Singh 1 Dec 14, 2021
Rust-blog - Educational blog posts for Rust beginners

pretzelhammer's Rust blog ?? I write educational content for Rust beginners and Rust advanced beginners. My posts are listed below in reverse chronolo

kirill 5.2k Jan 1, 2023
The ray tracer challenge in rust - Repository to follow my development of "The Raytracer Challenge" book by Jamis Buck in the language Rust

The Ray Tracer Challenge This repository contains all the code written, while step by implementing Ray Tracer, based on the book "The Ray Tracer Chall

Jakob Westhoff 54 Dec 25, 2022
Learn-rust-the-hard-way - "Learn C The Hard Way" by Zed Shaw Converted to Rust

Learn Rust The Hard Way This is an implementation of Zed Shaw's Learn X The Hard Way for the Rust Programming Language. Installing Rust TODO: Instruct

Ryan Levick 309 Dec 8, 2022
Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]

Rust Latam: procedural macros workshop This repo contains a selection of projects designed to learn to write Rust procedural macros — Rust code that g

David Tolnay 2.5k Dec 29, 2022
The Rust Compiler Collection is a collection of compilers for various languages, written with The Rust Programming Language.

rcc The Rust Compiler Collection is a collection of compilers for various languages, written with The Rust Programming Language. Compilers Language Co

null 2 Jan 17, 2022
Integra8 rust integration test framework Rust with a focus on productivity, extensibility, and speed.

integra8 Integra8 rust integration test framework Rust with a focus on productivity, extensibility, and speed. | This repo is in a "work in progress"

exceptional 3 Sep 26, 2022
Neofetch but in Rust (rust-toml-fetch)

rtfetch Configuration Recompile each time you change the config file logo = "arch.logo" # in src/assets. info = [ "", "", "<yellow>{host_n

Paolo Bettelini 6 Jun 6, 2022
Rust Sandbox [code for 15 concepts of Rust language]

Rust-Programming-Tutorial Rust Sandbox [code for 15 concepts of Rust language]. The first time I've been introduced to Rust was on January 2022, you m

Bek Brace 4 Aug 30, 2022
TypeRust - simple Rust playground where you can build or run your Rust code and share it with others

Rust playground Welcome to TypeRust! This is a simple Rust playground where you can build or run your Rust code and share it with others. There are a

Kirill Vasiltsov 28 Dec 12, 2022
Rust Imaging Library: A high-level Rust imaging crate.

ril Rust Imaging Library: A performant and high-level Rust imaging crate. Documentation • Crates.io • Discord What's this? This is a Rust crate design

Jay3332 18 Jan 5, 2023
In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.

Learn Rust What is this? In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang. This is usef

Domagoj Ratko 5 Nov 5, 2022
Game Boy Emulator written in Rust, as a way to fully grasp the Rust programming language

Flan's Game Boy Emulator Game Boy Emulator written in Rust, as a way to get hands-on with the Rust programming language, and creating a proper project

Flan 3 Dec 31, 2022