* refactor globals snapshot
* ignore test
* update pwasm-utils ref
* line width
* add doc comment for internal struct
* add explanation for iteration
* Demote rustdoc to a comment
* use 0.14
Co-authored-by: Sergei Shulepov <sergei@parity.io>
* seal: Change prefix "ext_" to "seal_" for contract callable functions
The word Ext is a overloaded term in the context of substrate. It usually
is a trait which abstracts away access to external resources usually in order
to mock them away for the purpose of tests. The contract module has its own
`Ext` trait in addition the the substrate `Ext` which makes things even more
confusing.
In order to differentiate the contract callable functions more clearly from
this `Ext` concept we rename them to use the "seal_" prefix instead.
This should change no behaviour at all. This is a pure renaming commit.
* seal: Rename import module from "env" to "seal0"
* seal: Fixup integration test
* seal: Add more tests for new import module names
* Rough skeleton for what I think the RPC should look like
* Create channel for sending justifications
Sends finalized header and justification from Grandpa to the
client. This lays the groundwork for hooking into the RPC module.
* WIP: Add subscribers for justifications to Grandpa
Adds the Sender end of a channel into Grandpa, through which notifications
about block finality events can be sent.
* WIP: Add a struct for managing subscriptions
Slightly different approach from the last commit, but same
basic idea. Still a rough sketch, very much doesn't compile yet.
* Make naming more clear and lock data in Arc
* Rough idea of what RPC would look like
* Remove code from previous approach
* Missed some things
* Update client/rpc-api/src/chain/mod.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Update client/rpc-api/src/chain/mod.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Split justification subscription into sender and receiver halves
* Replace RwLock with a Mutex
* Add sample usage from the Service's point of view
* Remove code that referred to "chain_" RPC
* Use the Justification sender/receivers from Grandpa LinkHalf
* Add some PubSub boilerplate
* Add guiding comments
* TMP: comment out to fix compilation
* Return MetaIoHandler from PubSubHandler in create_full
* Uncomment pubsub methods in rpc handler (fails to build)
* node/rpc: make Metadata concrete in create_full to fix compilation
* node: pass in SubscriptionManger to grandpa rpc handler
* grandpa-rpc: use SubscriptionManger to add subscriber
* grandpa-rpc: attempt at setting up the justification stream (fails to build)
* grandpa-rpc: fix compilation of connecting stream to sink
* grandpa-rpc: implement unsubscribe
* grandpa-rpc: update older tests
* grandpa-rpc: add full prefix to avoid confusing rust-analyzer
* grandpa-rpc: add test for pubsub not available
* grandpa-rpc: tidy up leftover code
* grandpa-rpc: add test for sub and unsub of justifications
* grandpa-rpc: minor stylistic changes
* grandpa-rpc: split unit test
* grandpa-rpc: minor stylistic changes in test
* grandpa-rpc: skip returning future when cancelling
* grandpa-rpc: reuse testing executor from sc-rpc
* grandpa-rpc: don't need to use PubSubHandler in tests
* node-rpc: use MetaIoHandler rather than PubSubHandler
* grandpa: log if getting header failed
* grandpa: move justification channel creation into factory function
* grandpa: make the justification sender optional
* grandpa: fix compilation warnings
* grandpa: move justification notification types to new file
* grandpa-rpc: move JustificationNotification to grandpa-rpc
* grandpa-rpc: move JustificationNotification to its own file
* grandpa: rename justification channel pairs
* grandpa: rename notifier types
* grandpa: pass justification as GrandpaJustification to the rpc module
* Move Metadata to sc-rpc-api
* grandpa-rpc: remove unsed error code
* grandpa: fix bug for checking if channel is closed before sendind
* grandpa-rpc: unit test for sending justifications
* grandpa-rpc: update comments for the pubsub test
* grandpa-rpc: update pubsub tests with more steps
* grandpa-rpc: fix pubsub test
* grandpa-rpc: minor indendation
* grandpa-rpc: decode instead of encode in test
* grandpa: fix review comments
* grandpa: remove unused serde dependency
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Jon Häggblad <jon.haggblad@gmail.com>
Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
* Revalidate transactions only on latest best block
We should revalidate transactions only on the latest best block and not
on any arbitrary block. The revalidation before failed when there were
multiple blocks on the height given to the revalidation function, but no
block was imported as best block.
* Update test-utils/runtime/transaction-pool/src/lib.rs
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
* Fix tests
* Only process best blocks in the transaction pool
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
* Pulled RPC from node and populated the node-template's RPC builder with one example implementation
* surpress build errror
* dead_code
* Fixed module usage, removed copyright, removed rpc builder for light client + some comments
* added a comment for rpc extension
* Update bin/node-template/node/src/rpc.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Update rpc.rs
* fix spacing
* more space to tabs
* more space to tabs
* Documenation nitpick
* Documentation nitpick
* Documentation nitpick
* Documentation nitpick
* Documentation nitpick
* pre-format
* Updated transaction payment API implemented for node template
* fix space and commented code
* fix long line
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Dan Forbes <dan@danforbes.dev>
* democracy use of weightinfo
* fix some doc and benchs
* todo generate from parity machine
* factorize and add license
* use final weights
* add slightly more sensible default weight
* refactor
* rename benchmark to avoid confusion
* just make remove_other_vote benchmark being the worst case of the extrinsic
* initial improvements
* better file management, ignore unused components
* Output warning when components unused
* update comment
* Write even when base weight is zero
* remove unwrap where possible
* Dont sort components to dedup
* undo delete
* improve clarity of unused components
* remove unused dep
* Update Process.json
* seal: Rework ext_transfer, ext_instantiate, ext_call error handling
* Deny calling plain accounts (must use transfer now)
* Return proper module error rather than ad-hoc strings
* Return the correct error codes from call,instantiate (documentation was wrong)
* Make ext_transfer fallible again to make it consistent with ext_call
* seal: Improve error messages on memory access failures
* seal: Convert contract trapped to module error
* seal: Add additional tests for transfer, call, instantiate
These tests verify that those functions return the error types
which are declared in its docs.
* Make it more pronounced that to_execution_result handles trap_reason
* Improve ReturnCode docs
* Fix whitespace issues in wat files
* Improve ReturnCode doc
* Improve ErrorOrigin doc and variant naming
* Improve docs on ExecResult and ExecError
* Encode u32 sentinel value as hex
* with_nested_context no longer accepts an Option for trie
* Fix successful typo
* Rename InvalidContractCalled to NotCallable
The transaction payment runtime api used its own extrinsic generic
parameter. This is wrong, because this resulted in using always the
native extrinsic. If there was a runtime upgrade that changed the
extrinsic in some way, it would result in the api breaking. The correct
way is to use the `Extrinsic` from the `Block` parameter. This is on the
node side the opaque extrinsic and on the runtime side the real extrinsic.
We need to order the delta before calculating the storage root, because
the order is important if the storage root is calculated using a storage
proof. The problem is arises when the delta is different than at the
time the storage root was recorded, because we may require a different
node that is not part of the proof and so, the storage root can not be
calculated. The problem is solved by always order the delta to use the
same order when calculating the storage root while recording the
stroage proof and when calculating the storage root using
the storage proof.
To prevent this bug in future again, a regression test is added.
Fixes: https://github.com/paritytech/cumulus/issues/146
* Allow blacklisting blocks from being finalized again after block revert
* Use BlockRules for storing unfinalized and add have_state_at in revert
* Move finalization_check in finalize_block upward
* Directly mark finalization blacklist as badblocks
* Remove obselete comment
* Update balance benchmarks
* Update weight functions
* Remove user component
* make componentless
* Add support for `#[extra]` tag on benchmarks
* Update balances completely
* Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* Fix some tests
* Maybe fix to test. Need approval from @tomusdrw this is okay
* Make test better
* keep weights conservative
* Update macro for merge master
* Add headers
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>