Sergei Pepyakin
d57f6f9305
Pass topics along with events ( #2563 )
...
* Introduce an IndexedEvent
* Plumb topics through the Ext interface.
* Add topics to ext_deposit_event
* Charging for events.
* Check the number of topics.
* Check for duplicate topics.
* Bump API version.
* Move derive(*Eq) under test.
* Use sorting for finding duplicates.
2019-05-14 12:09:51 +02:00
thiolliere
c7d9ca379d
Contract accounting removal ( #2230 )
...
* first partial implementation
* update rent allowance
* fmt
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* remove comments
* reward surcharge claims
* remove rent allowance in param + code_hash changed
* Fix bug
* fix tests
* fmt
* impl getter setter rent allowance
* fmt
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* comments
* doc + be->le
* doc
* doc
* fix improve fast return
* renamings
* rename + COMPLEXITY
* COMPLEXITY
* add test
* etrinsic claim surcharge delay configurable
* comment addressed
* move and rewrite of pay_rent
* remove child trie
* fmt
* use derive
* arithmetic operation
* fix
* fix storage root + checked_mul + test
* WIP: test
* WIP
* add tests and fix
* fmt
* typo and doc suggestions
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* WIP
* address some comments
divide tests + some docs
* use br_table
* remove unused function
* Bump the runtime version
* insert_with
* Add some comments.
* Refactor
* Shuffle and fix comments
* More comment fixes.
* dues limited
* Add comment
* Handicap
* Docs.
* Apply suggestions from code review
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Coalesce block_passed in a block
* Fix build
* Paid → Ok
* match → if
* Imrpove handicap description
2019-04-30 09:41:33 +02:00
Michael Müller
a0e0d9b03d
Fix typos and markdown ( #2388 )
...
* Fix typos
* Align properly
* Update core/consensus/slots/src/lib.rs
Co-Authored-By: cmichi <mich@elmueller.net >
* Update core/network/src/test/mod.rs
Co-Authored-By: cmichi <mich@elmueller.net >
* Update core/finality-grandpa/src/communication/mod.rs
Co-Authored-By: cmichi <mich@elmueller.net >
* Update core/consensus/common/src/import_queue.rs
Co-Authored-By: cmichi <mich@elmueller.net >
2019-04-26 14:09:13 +02:00
Sergei Pepyakin
07268022cc
contracts: Validate code before deployment ( #2330 )
...
* Validate module before storing it in code_cache.
* Bump version.
2019-04-19 13:35:11 -04:00
Andrew Jones
1e0c1d8850
Introduce ext_println to contract runtime ( #2239 )
...
* Implement `ext_println` in contract runtime
* Only allow contracts to import `ext_println` on dev chains
* Configure dev chain to allow contracts with `ext_println`
* Increment spec version
* Docs
* Rename config to the more specific enable_println
2019-04-11 15:49:17 +02:00
Andrew Jones
03f3fb1442
Contract import/export validation ( #2203 )
...
* Reject validation of contract with unknown exports
* Validate imports eagerly
* Increment spec version
2019-04-06 13:23:56 +02:00
Andrew Jones
b3931d3e2a
Remove redundant Ok(()) and explicitly specify StorageKey buffer type ( #2188 )
2019-04-03 11:59:03 +02:00
Andrew Jones
4c115e3f2d
Replace Vec<u8> with [u8; 32] for contract storage key ( #2184 )
...
* Replace Vec<u8> with [u8; 32] for contract storage key
* Read storage keys from sandbox memory into fixed size buffer
* Increment `impl_version`
2019-04-03 10:12:54 +02:00
thiolliere
c98db99d80
implement contract events ( #2161 )
...
* implement contract events
* update runtime
* renaming
* update test code hash
* improve complexity details
* add deposit event base cost
* add test
* Revert "add deposit event base cost"
This reverts commit 58ec010c0f4f4f0e16935ad41da32aedd17a8c57.
* update test
* Revert "update test"
This reverts commit 6fe61a593ccf0d41f09a0b97472b28ed8751a999.
* Revert "Revert "add deposit event base cost""
This reverts commit 145e8a9bac15313a4c380aa66b94fd4d36fa3f6d.
* Fix format a bit
2019-04-03 08:20:01 +02:00
thiolliere
29001cb469
Decouple contract from balances ( #2081 )
...
* decouple contract from balance
* update impls and builds
* set fees in contract module
* builds
2019-03-28 13:46:30 +01:00
Gav Wood
d7fcf5dc9d
Overhaul crypto (Schnorr/Ristretto, HDKD, BIP39) ( #1795 )
...
* Rijig to Ristretto
* Rebuild wasm
* adds compatibility test with the wasm module
* Add Ed25519-BIP39 support
* Bump subkey version
* Update CLI output
* New keys.
* Standard phrase/password/path keys.
* Subkey uses S-URI for secrets
* Move everything to use new HDKD crypto.
* Test fixes
* Ignore old test vector.
* fix the ^^ old test vector.
* Fix tests
* Test fixes
* Cleanups
* Fix broken key conversion logic in grandpa
CC @rphmeier
* Remove legacy Keyring usage
* Traitify `Pair`
* Replace Ed25519AuthorityId with ed25519::Public
* Expunge Ed25519AuthorityId type!
* Replace Sr25519AuthorityId with sr25519::Public
* Remove dodgy crypto type-punning conversions
* Fix some tests
* Avoid trait
* Deduplicate DeriveJunction string decode
* Remove cruft code
* Fix test
* Minor removals
* Build fix
* Subkey supports sign and verify
* Inspect works for public key URIs
* Remove more crypto type-punning
* Fix typo
* Fix tests
2019-03-13 14:08:31 +01:00
Bastian Köcher
7927054f86
Update copyrights to 2019 ( #1932 )
2019-03-06 15:04:28 +01:00
Hero Bird
128d164f2b
Make use of parity-codec "derive" crate feature ( #1919 )
...
* Make use of parity-codec "derive" crate feature
* Bump impl_version
* Update wasm files and Cargo.lock files
* Transferred to parity_codec derive feature for the rest of the crates
* Update wasm binaries and lock files
* Update core and node wasm binaries
2019-03-05 09:00:37 +01:00
Stanislav Tkach
ca69ad4c30
Migrate smrl-treasury and srml-upgrade-key to the 2018 edition ( #1725 )
2019-02-09 18:06:20 +01:00
Jordan Beauchamp
fb0f4dfb03
Expose block random seed and timestamp to contract ABI ( #1630 )
...
* Expose block random seed and timestamp to contract ABI
* Add tests
* Bump spec version
2019-02-07 10:58:02 +01:00
Benjamin Kampmann
15ae7cfef6
Document more TODOs as tickets ( #1418 )
...
Went through the TODOs, removed a bunch, which are outdated or nothing more than a regular comment, documented a bunch more as actual tickets and made them FIXMEs and unified their structure (`FIXME #TICKETNO DESC` for local tickets, `FIXME: DESC LINK` for external tickets) for easier in-editor support. Further more remove unnecessary remarks and related old code that I noticed in that instance.
2019-01-30 10:29:48 +01:00
Gav Wood
c132e84572
Additional externs for ecdsa recovery and keccak ( #1583 )
...
* Additional externs for ecdsa recovery and keccak
* Update core/executor/src/wasm_executor.rs
Co-Authored-By: gavofyork <github@gavwood.com >
* Update core/executor/src/wasm_executor.rs
Co-Authored-By: gavofyork <github@gavwood.com >
* Fix grumble
* Grumble.
2019-01-25 19:07:02 +00:00
Sergei Pepyakin
a5cafa68b1
Update srml-contract to Rust 2018. ( #1510 )
...
* Fix imports.
* Remove redundant binding
* Clean extern crates.
* Add comment
* Re-export macros from prelude
* Build fixes
* Update core/sr-std/src/lib.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
2019-01-24 16:26:53 +01:00
thiolliere
2492931944
compact param in calls ( #1499 )
...
* impl #[codec(compact)] for param
* update modules
* test all and build runtime
* Update srml/support/src/dispatch.rs
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* Update srml/support/src/dispatch.rs
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* delete wip comment
* update param to use #[compact] instead of Cmpact<>
* fmt
* impl metadata
* test metadata
* add compact attr test
* script buid
* update test
2019-01-22 14:42:13 +01:00
Sergei Pepyakin
58cd6530be
Dispatch Calls to other modules ( #1473 )
...
* WIP
* Use system::Origin::Signed as an origin
* Add a vm test for ext_dispatch_call
* Take fee for dispatching a Call
# Conflicts:
# node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm
* Clean & Rebuild
# Conflicts:
# node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm
* Dispatch call test.
* Rebuild the runtime.
* Fix the length of the buffer.
* Rebuild binaries.
2019-01-22 13:10:14 +01:00
Sergei Pepyakin
603392a9b9
Remove gas function from the public API ( #1503 )
...
* Disallow importing `gas` function
* Update srml/contract/src/wasm/prepare.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
2019-01-21 16:21:32 +01:00
Sergei Pepyakin
f0dbcf5401
Verify that contracts cannot use float operations ( #1504 )
2019-01-21 14:04:58 +01:00
Sergei Pepyakin
0ad2a5fb96
Some trivial externalities added ( #1450 )
...
* Add gas_left, gas_price and balance externalities
* Add a value_transferred externality
2019-01-19 12:33:28 +01:00
Sergei Pepyakin
c88b44f6db
Contracts module rejig ( #1358 )
...
* Move prepare under code.
* Schedule update
* CodeHash
* create takes code_hash
* pass mem def and use code in vm::execute
* Actually save and load code
* Use T::Hash as CodeHash
* Explicit entrypoint name
* Return code_hash and deposit an Event
* Charge for deployed code with gas.
* ImportSatisfyCheck and FunctionImplProvider
* Progress.
* Use new infrastructure for checking imports
* Rename entrypoint to entrypoint_name
* Use strings instead of a Error enum
* Clean
* WIP
* Fix macro_define_env test.
* Fix vm code tests.
* Remove tests for now.
* Fix borked merge
* Fix build for wasm
* fmt
* Scaffolding for abstracting vm.
* Hook up execution to exec layer.
* Fix vm tests.
* Use schedule directly in WasmLoader
* Implement test language.
* Add input_data test.
* Max depth test
* ext_caller
* Simplify test.
* Add TODO
* Some tests and todos.
* top_level
* Clean.
* Restore a couple of integration tests.
* Add a few comments.
* Add ext_address runtime call.
* Deduplicate caller/self_account
* Add not_exists test.
* Change bool to TransferCause.
* Add address tests.
* Remove output_buf from parameter.
* return from start fn.
* Smart gas meter
* Tracing
* Fix prepare tests.
* Code moving
* Add ExecFeeToken
* Use tokens everywhere.
* Make it compile in no_std.
* Lift all test requirements to TestAuxiliaries
* A minor clean
* First create tests
* Remove unneeded TODO
* Docs.
* Code shuffling
* Rename create → instantiate
* Add test address.
* Code shuffling
* Add base_fee tests.
* rejig the code
* Add some comments
* on_finalise comment
* Move event deposit further
* Update Cargo.lock
* Use crates.io version of pwasm-utils
* Format todo comments
* Fix formatting
* Comments
* EmptyOutputBuf and OutputBuf split.
* Restore code_hash
* Fix node-executor.
* Fix typo
* Fix fmt
* Update srml/contract/src/account_db.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/lib.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Line wraps
* Wrapping macros
* Add _ prefix
* Grumbles
* Doc updates.
* Update srml/contract/src/wasm/mod.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/lib.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Add comment
* Use saturation to signal overflow
* Add prepare_test! macro
* Require deploy function.
* Add entry point tests
* Add comment.
* Rename code → code_cache to better describe
* Get rid of weird match!
* Recompile binaries
* Add comments
* refuse_instantiate_with_value_below_existential_deposit
* Little fix
* Make test more complete
* Clean
* Add integration test for instantiation
* Rebuild runtime.
* Add some tests.
* Attach an issue to a TODO
* Attach another issue
* Apply suggestions from code review
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/exec.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/exec.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Recompile node_runtime
2019-01-17 12:01:12 +01:00