- Jul 27, 2020
-
-
Alexander Theißen authored
* seal: Fail instantiate if new contract is below subsistence threshold We need each contract that exists to be above the subsistence threshold in order to keep up the guarantuee that we always leave a tombstone behind with the exception of a contract that called `ext_terminate`. * Fixup executor test * Bump runtime
-
- Jul 10, 2020
-
-
Alexander Theißen authored
* seal: Do not allow transfers to bring total balance below subsistence deposit This also reworks the rent system to take the total balance into account when evaluating whether the account is above the subsistence deposit. * Fix nits from review * Fix typo * Do not enforce subsistence when called from EOA * Rename CallOrigin to TransactorKind * Add debug asserts to check the invariants of a plain account transactor * Fix typo Co-authored-by: Sergei Shulepov <[email protected]> Co-authored-by: Sergei Shulepov <[email protected]>
-
- Jul 09, 2020
-
-
Alexander Theißen authored
* Transition getter functions to not use scratch buffer * Remove scratch buffer from ext_get_storage * Remove scratch buffer from ext_call * Remove scratch buffer from ext_instantiate * Add ext_input and remove scratch buffer * Rework error handling (changes RPC exposed data) * ext_return passes a flags field instead of a return code * Flags is only for seal and not for the caller * flags: u32 replaced status_code: u8 in RPC exposed type * API functions use a unified error type (ReturnCode) * ext_transfer now traps on error to be consistent with call and instantiate * Remove the no longer used `Dispatched` event * Updated inline documentation * Prevent skipping of copying the output for getter API * Return gas_consumed from the RPC contracts call interface * Updated COMPLEXTITY.md * Rename ext_gas_price to ext_weight_to_fee * Align comments with spaces * Removed no longer used `ExecError` * Remove possible panic in `from_typed_value` * Use a struct as associated data for SpecialTrap::Return * Fix nits in COMPLEXITY.md * Renamed SpecialTrap to TrapReason * Fix test * Finish renaming special_trap -> trap_reason * Remove no longer used get_runtime_storage * fixup! Remove no longer used get_runtime_storage * Removed tabs for comment aligment
-
- Jun 24, 2020
-
-
Alexander Theißen authored
Those are way too hard to audit and make only sense with specific chains. They shouldn't be in the core API.
-
Alexander Theißen authored
* seal: Refactor ext_gas_price * Remove seals dependency on pallet_transaction_payment * Add weight as an argument to ext_gas_price * Fixed documentation nits from review * Do not use unchecked math even in test code
-
- Jun 23, 2020
-
-
Sergey Pepyakin authored
* Add a simple direct storage access module * WIP * Completely migrate to the transactional system. * Format * Fix wasm compilation * Get rid of account_db module * Make deposit event eager * Make restore_to eager * It almost compiles. * Make it compile. * Make the tests compile * Get rid of account_db * Drop the result. * Backport the book keeping. * Fix all remaining tests. * Make it compile for std * Remove a stale TODO marker * Remove another stale TODO * Add proof for `terminate` * Remove a stale comment. * Make restoration diverging. * Remove redudnant trait: `ComputeDispatchFee` * Update frame/contracts/src/exec.rs Co-authored-by: Alexander Theißen <[email protected]> * Introduce proper errors into the storage module. * Adds comments for contract storage module. * Inline `ExecutionContext::terminate`. * Restore_to should not let sacrifice itself if the contract present on the stack. * Inline `transfer` function * Update doc - add "if succeeded" * Adapt to TransactionOutcome changes * Updates the docs for `ext_restore_to` * Add a proper assert. * Update frame/contracts/src/wasm/runtime.rs Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
-
- Apr 24, 2020
-
-
Alexander Theißen authored
Co-Authored-By: Tomasz Drwięga <[email protected]> Co-Authored-By: Sergei Pepyakin <[email protected]>
-
- Mar 25, 2020
-
-
Sergey Pepyakin authored
-
- Mar 20, 2020
-
-
Hero Bird authored
* Implement ext_ hashes for contracts (issue #5258) * load cryto hash .wat from raw string literal instead of file * update .wat contents for testing crypto hashes * remove unnecessary 'static * fix bug in input (call_indirect required 1+ at least it seems) * no longer use scratch buffer for crypto hash functions * improve doc comments of ext_ hash functions * remove unnecessary comment in .wat test file * add return value (const 0) to contract test to hopefully enable result buffer * fix bug in contract assertion * implement proper output_len in contract * implement proper test for crypto hashes * bump spec_version 238 -> 239 * fix COMPLEXITY description * remove final invalid instances of scratch buffer from docs
-
- Mar 17, 2020
-
-
Alexander Theißen authored
With this patch forward this will be the only way for a contract to destroy itself. This patch therefore changes the semantics of all other contract initiated balance transfers to fail if they would bring the caller below the existential deposit.
-
- Mar 14, 2020
-
-
Alexander Theißen authored
* contracts: Add ext_transfer call This call allows contracts to send balance to any account contract or not. Previously, the only way to do that was though ext_call. * Apply suggestions from code review Co-Authored-By: Nikolay Volf <[email protected]> * The define_env! macro does not allow for trailing comma * Update frame/contracts/src/exec.rs Co-Authored-By: Nikolay Volf <[email protected]> * Bump spec version * Do not use nested gas meter * Use explicit 0 or 1 as return value * Remove superflous intermediate binding Co-authored-by: Nikolay Volf <[email protected]>
-
- Mar 11, 2020
-
-
Hero Bird authored
* split out ext_clear_storage from ext_set_storage contracts API * update tests to adjust for the ext_set_storage changes * adjust COMPLEXITY for the ext_set_storage API changes * remove value_len == 0 constraint for ext_set_storage * bump spec_version * remove guarantee from COMPLEXITY of ext_clear_storage Co-authored-by: Gavin Wood <[email protected]>
-
- Feb 17, 2020
-
-
Shawn Tabrizi authored
* meaningfull -> meaningful * initialise -> initialize * tokans -> tokens * incentivise -> incentivize * lenght -> length * incentivisation -> incentivization * doesnt't -> doesn't * overwriten -> overwritten * lifecycle -> life cycle * lifecycle -> life cycle * usefull -> useful * noone -> no one * spaming -> spamming * defered -> deferred * hieght -> height * sumation -> summation * ingore -> ignore * registed -> registered * Auxialary -> Auxiliary * loggin -> logging * independance -> independence * trailling -> trailing * responsability -> responsibility * trunkated -> truncated * Weither -> Whether * informations -> information * Runtume -> Runtime * choosen -> chosen * delcataion -> declaration * Unchekced -> Unchecked * defintion -> definition * scrach -> scratch * imput -> input * transfered -> transferred * endownment -> endowment * Determinator -> Determiner * relevent -> relevant * emited -> emitted * acocunt -> account * proprotional -> proportional * instantiaion -> instantiation * commited -> committed * tombstonedead -> tombstone * uwnrap -> unwrap * acount -> account * specialised -> specialized * existant -> existent * requried -> required * Anull -> Annul * AUTHORITES -> AUTHORITIES * underyling -> underlying * recognisable -> recognizable * Capitalise -> Capitalize * reportfor -> report for * hearbeat -> heartbeat * onlineness -> being online * creater -> creator * Bytearray -> Byte array * Despoit -> Deposit * substratced -> subtracted * Curent -> Current * imbalanes -> imbalances * countfown -> countdown * inexisting -> inexistent * additionaly -> additionally * substracted -> subtracted * auxilary -> auxiliary * parital -> partial * in't -> isn't * compatability -> compatibility * infomation -> information * etected -> detected * extrinsiscs -> extrinsics * reprensentation -> representation * coonfiguration -> configuration * primtives -> primitives * miscelanious -> miscellaneous * VERISON -> VERSION * endcoded -> encoded * Genrates -> Generates * miliseconds -> milliseconds * occured -> occurred * trully -> truely * truely -> truly * conjuction -> conjunction * encouters -> encounters * customised -> customized * deterministicly -> deterministically * finalisation -> finalization * pluggable -> plugable * wakeup -> wake-up * interemdiate -> intermediate * intepreting -> interpreting * finalzied -> finalized * throgh -> through * extinsic -> extrinsic * convient -> convenient * allocater -> allocator * propagateable -> propagatable * succesfuly -> successfully * finalising -> finalizing * publically -> publicly * phrasee -> phrase * substration -> substractions * substractions -> subtractions * neccessarily -> necessarily * Inlucde -> Include * unefficient -> inefficient * thay -> they * funtion -> function * datastructures -> data structures * infromation -> information * propagatable -> propagable * ecountered -> encountered * recognise -> recognize * intergration -> integration * lastet -> latest * datatypes -> data types * datatype -> data type * Strongarming -> Strong Arming * avaible -> available * Commiting -> Committing * Retreiving -> Retrieving * shoud -> should * canonicaliziation -> canonicalization * comitted -> committed * clonable -> cloneable * Uknown -> Unknown * reponse -> response * arbitary -> arbitrary * Capapbilities -> Capabilities * responsbile -> responsible * initialisation -> initialization * cames -> came * intemediate -> intermediate * reqeust -> request * intance -> instance * explcitly -> explicitly * neighor -> neighbor * reolving -> resolving * untill -> until * Validte -> Validate * deserailize -> deserialize * literaly -> literally * preceeding -> preceding * abpve -> above * chcecked -> checked * numbet -> number * Unknow -> Unknown * halfs -> halves * gossup -> gossip * givent -> given * immediatelly -> immediately * slicable -> sliceable * conensus -> consensus * Mimicks -> Mimics * acccept -> accept * serialise -> serialize * exstrinsics -> extrinsics * panicks -> panics * maintaince -> maintenance * repeatidely -> repeatedly * anecstor -> ancestor * becasue -> because * processer -> processor * Prunning -> Pruning * insterested -> interested * unuseful -> not useful * yeided -> yielded * descendfing -> descending * corresponts -> corresponds * survivew -> survive * keps -> keeps * ligh -> light * prerequisities -> prerequisites * positiion -> position * depedency -> dependency * extrinisic -> extrinsic * atomicaly -> atomically * staticly -> statically * resul -> result * timestamb -> timestamp * Utilites -> Utilities * ammount -> amount * pocess -> process * exteral -> external * Update client/finality-grandpa/src/tests.rs * Update primitives/io/src/lib.rs Co-Authored-By: joe petrowski <[email protected]> * Update primitives/blockchain/src/lib.rs Co-Authored-By: joe petrowski <[email protected]> * Update frame/support/src/weights.rs Co-Authored-By: joe petrowski <[email protected]> * Update bin/node/cli/tests/common.rs Co-Authored-By: joe petrowski <[email protected]> * Update client/api/src/execution_extensions.rs Co-Authored-By: joe petrowski <[email protected]> * Update client/cli/src/params.rs Co-Authored-By: joe petrowski <[email protected]> * Update client/executor/common/src/sandbox.rs Co-Authored-By: joe petrowski <[email protected]> * Update client/api/src/execution_extensions.rs Co-Authored-By: joe petrowski <[email protected]> * Update client/finality-grandpa/src/communication/mod.rs Co-Authored-By: joe petrowski <[email protected]> * Update client/state-db/src/pruning.rs Co-Authored-By: joe petrowski <[email protected]> * Update frame/contracts/src/tests.rs Co-Authored-By: joe petrowski <[email protected]> * Update client/api/src/execution_extensions.rs * bump impl * timestamb -> timestamp Co-authored-by: joe petrowski <[email protected]>
-
- Feb 14, 2020
-
-
Alexander Theißen authored
* contracts: Allow to distinguish out of gas from other traps When a contract encounters a runtime error a wasm trap is triggered and the execution is halted. Currently, no matter what was the cause for the trap it is always reported as: DispatchError::Other("contract trapped during execution"). However, the trap that is triggered if a contract exhausts its gas budget is particulary interesting. Therefore we add a seperate error message for this cause: DispatchError::Other("ran out of gas during contract execution"). A test is added hat executes a contract that never terminates. Therefore it always exhausts is gas budget. * fixup! contracts: Allow to distinguish out of gas from other traps Remove overlong lines. * fixup! contracts: Allow to distinguish out of gas from other traps Rename Contract to Contracts
-
- Jan 29, 2020
-
-
Bastian Köcher authored
* Add `get_global` for `Sandbox` This pr adds `get_global` to retrieve a `global` variable from an instantiated sandbox wasm blob. * Bump `spec_version` * Update primitives/wasm-interface/src/lib.rs Co-Authored-By: Sergei Pepyakin <[email protected]> * `get_global` -> `get_global_val` Co-authored-by: Sergei Pepyakin <[email protected]> Co-authored-by: Gavin Wood <[email protected]>
-
- Jan 23, 2020
-
-
* [contracts] add ext_tombstone_deposit * [contracts] update tombstone_deposit docs
-
- Jan 21, 2020
-
-
* contracts: during execution -> contract trapped during execution This message confused many people so we are improving it to make clear what happened. * contracts: rename Event::Contract -> Event::ContractExecution * contracts: fix tests after ContractExecution renaming * contracts: Add Evicted and Restored events * fix doc comment * wrap to not go over (soft) 100 column line limit * add event deposit for eventual eviction upon pay_rent * contracts: adjust tests for the new events * emit Evicted event immediately and add tombstone flag bool
-
- Jan 05, 2020
-
-
Shawn Tabrizi authored
-
- Dec 19, 2019
-
-
Bastian Köcher authored
* Make `decl_error!` errors usable This pr implements support for returning errors of different pallets in a pallet. These errors need to be declared with `decl_error!`. The pr changes the following: - Each dispatchable function now returns a `DispatchResult` which is an alias for `Result<(), DispatchError>`. - `DispatchError` is an enum that has 4 variants: - `Other`: For storing string error messages - `CannotLookup`: Variant that is returned when something returns a `sp_runtime::LookupError` - `BadOrigin`: Variant that is returned for any kind of bad origin - `Module`: The error of a specific module. Contains the `index`, `error` and the `message`. The index is the index of the module in `construct_runtime!`. `error` is the index of the error in the error enum declared by `decl_error!`. `message` is the message to the error variant (this will not be encoded). - `construct_runtime!` now creates a new struct `ModuleToIndex`. This struct implements the trait `ModuleToIndex`. - `frame_system::Trait` has a new associated type: `ModuleToIndex` that expects the `ModuleToIndex` generated by `construct_runtime!`. - All error strings returned in any module are being converted now to `DispatchError`. - `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`. * Fix frame system benchmarks
-
- Dec 16, 2019
-
-
Tomasz Drwięga authored
* Rename: Phase 1. * Unify codec. * Fixing: Phase 2 * Fixing: Phase 3. * Fixing: Phase 4. * Fixing: Phase 5. * Fixing: Phase 6. * Fixing: Phase 7. * Fixing: Phase 8. Tests * Fixing: Phase 9. Tests!!! * Fixing: Phase 10. Moar tests! * Finally done! * More fixes. * Rename primitives:: to sp_core:: * Apply renames in finality-grandpa. * Fix benches. * Fix benches 2. * Revert node-template. * Fix frame-system in our modules.
-
- Dec 10, 2019
-
-
Weiliang Li authored
* primitives/sr-std -> primitives/std * fix * fix conflict * rstd -> sp-std * git mv * fix review * fix merge
-
- Dec 02, 2019
-
-
Benjamin Kampmann authored
* Adding script for rename, could be applicable for nodes on top of it, too * add stderr and gitlab ci features * apply script * fix now minor details in expected stderr * Update the Cargo.lock * fix name: sc-transaction -> sc-tracing * fix rename in script, too
-
- Nov 22, 2019
-
-
Shawn Tabrizi authored
* palette -> frame * PALETTE, Palette -> FRAME * Move folder pallete -> frame * Update docs/Structure.adoc Co-Authored-By: Benjamin Kampmann <[email protected]> * Update docs/README.adoc Co-Authored-By: Benjamin Kampmann <[email protected]> * Update README.adoc
-
- Nov 21, 2019
-
-
joe petrowski authored
* /paint to /palette * rename paint to palette * rename the modules in palette to be pallets * update Structure.adoc * bump impl * fix CI directory * Update docs/Structure.adoc Co-Authored-By: Benjamin Kampmann <[email protected]>
-
- Nov 18, 2019
-
-
Sergey Pepyakin authored
* Add `ext_get_runtime_storage` * Implement testing for ext_get_runtime_storage * Add integration test. * Update spec version * Fix the doc * Save memory allocation.
-
- Nov 14, 2019
-
-
Benjamin Kampmann authored
* Adding first rough ouline of the repository structure * Remove old CI stuff * add title * formatting fixes * move node-exits job's script to scripts dir * Move docs into subdir * move to bin * move maintainence scripts, configs and helpers into its own dir * add .local to ignore * move core->client * start up 'test' area * move test client * move test runtime * make test move compile * Add dependencies rule enforcement. * Fix indexing. * Update docs to reflect latest changes * Moving /srml->/paint * update docs * move client/sr-* -> primitives/ * clean old readme * remove old broken code in rhd * update lock * Step 1. * starting to untangle client * Fix after merge. * start splitting out client interfaces * move children and blockchain interfaces * Move trie and state-machine to primitives. * Fix WASM builds. * fixing broken imports * more interface moves * move backend and light to interfaces * move CallExecutor * move cli off client * moving around more interfaces * re-add consensus crates into the mix * fix subkey path * relieve client from executor * starting to pull out client from grandpa * move is_decendent_of out of client * grandpa still depends on client directly * lemme tests pass * rename srml->paint * Make it compile. * rename interfaces->client-api * Move keyring to primitives. * fixup libp2p dep * fix broken use * allow dependency enforcement to fail * move fork-tree * Moving wasm-builder * make env * move build-script-utils * fixup broken crate depdencies and names * fix imports for authority discovery * fix typo * update cargo.lock * fixing imports * Fix paths and add missing crates * re-add missing crates
-
- Sep 23, 2019
-
-
* Rename more things related to contract instantiation * rename `creator_ch` * Fix node runtime * fix contracts tests * Little fix
-
- Sep 20, 2019
-
-
* Finish off srml-contract create -> instantiate renamings * bumped spec_version
-
- Sep 13, 2019
-
-
Bastian Köcher authored
* Move trait `Printable` into `sr-primitives` * Cleanup runtime io trie_root interfaces * Remove last generic bits from sr-io interface * Fix srml-sudo after master merge * Fix benchmarks * Runtime bump
-
- Sep 01, 2019
-
-
Sergey Pepyakin authored
-
- Aug 21, 2019
-
-
Jim Posen authored
* Add ability to destroy a contract in the overlay. * Don't allow contracts to be destroyed in recursive execution. * Tests for contract self-destruction. * Don't allow constructor to exit with insufficient balance. * Remove dead code. * Bump node runtime spec version.
-
- Aug 12, 2019
-
-
Jim Posen authored
* srml-contracts: Rename ext_scratch_copy to ext_scratch_read. This is to disambiguate from the next ext_scratch_write function. * Remove unnecessary OutputBuf and EmptyOutputBuf. * Replace VmExecError with a result type of custom structs. * Do not drop the scratch buffer on traps and regular returns. This just reduces the number of allocations required during nested contract calls and instantiations. * Semantics for returning a status code and data from contract calls. * Remove CallReceipt and InstantiateReceipt. With forthcoming changes to return data from instantiate calls, the two types of receipts become very similar to each other and to ExecReturnValue. Instead, replace them with ExecReturnValue and a regular 2-tuple in the case of instantiation. * Modify contract function signatures to allow returning status codes. * Introduce ext_sandbox_write runtime function. * Test all the things. * Bump node runtime spec version. * Style fixes.
-
- Aug 08, 2019
-
-
Jim Posen authored
* srml-contracts: Storage access micro-optimization. * srml-contracts: Refactor runtime functions to reduce duplication. * Bump node runtime impl version.
-
- Aug 06, 2019
-
-
thiolliere authored
* WIP: update codec * WIP * compiling * WIP * rename parity-scale-codec to codec * WIP * fix * remove old comments * use published crates * fix expected error msg * bump version * fmt and fix * remove old comment * fix wrong decoding impl * implement encode like for structures * undo removal of old pending changes * trailingzeroinput * Apply suggestions from code review Co-Authored-By: Bastian Köcher <[email protected]> Co-Authored-By: DemiMarie-parity <[email protected]> * update codec * fmt * version is 1.0.0 * show more error * fmt
-
- Aug 02, 2019
-
-
Sergey Pepyakin authored
* Adjust documentation. * Bump impl_version. * Update srml/contracts/src/wasm/runtime.rs Co-Authored-By: Hero Bird <[email protected]> * Remove incorrect doc.
-
- Aug 01, 2019
-
-
Sergey Pepyakin authored
* Switch to deferred actions * Make restore_to a deferred action. * Bump version. * Review fixes.
-
- Jul 29, 2019
-
-
Kian Paimani authored
* refactor sr_primitives. * Fix try build error. * Line-width * Ui test. * Final fixes. * Fix build again. * bring back ui test. * Fix unsigned import. * Another ui fix. * Also refactor substrate-primitives * Fix benchmarks. * Fix doc test. * fix doc tests
-
- Jul 16, 2019
-
-
* srml-contracts: Remove hard-coded code hashes from tests. This makes it easier to update existing and add new test Wasm modules. * Test maximum contract storage write size. * Implement storage value limit for contracts. * Bump node runtime spec version.
-
- Jul 10, 2019
-
-
* add block number * add ext_current_block * add ext_current_block test * Update srml/contracts/src/wasm/mod.rs Co-Authored-By: Sergei Pepyakin <[email protected]> * Update srml/contracts/src/wasm/mod.rs Co-Authored-By: Sergei Pepyakin <[email protected]> * change valid comment * use BlockNumberOf<T> * Update srml/contracts/src/exec.rs Co-Authored-By: André Silva <[email protected]> * return types copy, not reference * version up spec_version and impl_version * change method name current_block -> block_number * Update srml/contracts/src/exec.rs Co-Authored-By: Sergei Pepyakin <[email protected]>
-
- Jun 27, 2019
-
-
* srml-contract: Refactor away unnecessary Option. * srml-contract: Add assertion to gas_left test. * srml-contract: Refactor try_evict_or_and_pay_rent to make tests pass. * srml-contract: Add tests and comments for bugs in rent payment logic. * srml-contract: Minor cleanup using GasMeter constructor. * Bump node runtime impl version.
-