This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Make contract a separate runtime module #345
Merged
Merged
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit
Hold shift + click to select a range
8bb5143
decl_module and extract runtime mod
pepyakin 7fa574f
Invert dependency staking←→contract
pepyakin 8c06e98
Remove CodeOf
pepyakin f315ca0
Remove StorageOf and move double_map
pepyakin 799e591
Comment staking test
pepyakin 92922fd
Clean
pepyakin d43ab98
Add gas_price and gas_limit
pepyakin 92cfeeb
Commit.
pepyakin a4264f3
Renames
pepyakin 9d07af9
Params
pepyakin 00919a4
WIP
pepyakin 900c859
Rename transfer to call
pepyakin 593d51c
WIP
pepyakin 0b501c6
Rebuild binaries.
pepyakin ce0e128
WIP
pepyakin 8915d76
Backport ctro changes
pepyakin ca48073
Call wiring
pepyakin 3f2423f
Commit overlay.
pepyakin 32b0e55
Rename merge → commit, into_state → ..._change_set
pepyakin 8577fad
WIP
pepyakin 14ee2f4
Contract creation routines
pepyakin 3a218d9
Set code of the created account.
pepyakin e8157c6
Fix the ID of `create` Call
pepyakin 43508cd
Fix most of the warning.
pepyakin a4b6480
Add the simplest test in the contract crate
pepyakin a340742
Transfers work!
pepyakin e3b906c
Add contract_create test.
pepyakin 8a541a3
Clean
pepyakin 77ee25b
Add top-level create test
pepyakin 30a72d3
Clean a bit.
pepyakin 51ee15d
Pass gas_limit and data via create.
pepyakin 9c1c246
Introduce OnAccountKill callback in staking
pepyakin 3d3a4b7
Hook up OnAccountKill
pepyakin 6ccefe6
Comments
pepyakin 856de95
Pay for gas.
pepyakin b3c256b
Refund unused gas in call
pepyakin 18a36a3
Tests for zero call and zero endownment.
pepyakin 1872173
Add todo about rewriting docs
pepyakin 8be77ad
Pay for gas in create transactions
pepyakin 0df8491
Fix refunds
pepyakin 25492de
Clean unrelevant comments
pepyakin f3a2ebf
fixup! Fix refunds
pepyakin ea2254d
fixup! Clean unrelevant comments
pepyakin 315c0ea
Move DetermineContractAddress to contract
pepyakin 3ab381c
fixup! Clean unrelevant comments
pepyakin b513597
Inline effect_transfer, remove effect_create
pepyakin cdb2eeb
Merge 'origin/master' into ser-contract-ioc
pepyakin d54cec0
Use own new_test_ext.
pepyakin 4032b2f
Don't account for liability
pepyakin 3dfd294
Add some docs
pepyakin f276d52
Move contract_fee into contract module
pepyakin 42d3fb8
Take GasMeter in vm::execute
pepyakin 75631f6
Use GasMeter throughout contract module for meter
pepyakin c2bc86d
gas module refactoring
pepyakin bf07b3c
Clean
pepyakin 952112c
Add base call fee
pepyakin fa8991e
note about gas price should be taken from storage
pepyakin 3e70be5
Add base fee for create
pepyakin 87c5b12
Rename send → call
pepyakin f15ac41
Clean
pepyakin 41f33b7
Take fee expressed in dots in gas
pepyakin cb6e995
Add Checked{Add,Sub,Mul,Div} to SimpleArithmetic
pepyakin 8e5f297
Make Gas generic
pepyakin b16fec1
Store {call,create}_base_fee in storage
pepyakin 6072034
Clean
pepyakin 5bd0ee9
Rename buy_gas
pepyakin dadf9d8
Store gas_price in the storage
pepyakin 6c93532
Remove unneeded comment.
pepyakin b84d090
Bail out if contract already has code.
pepyakin 259a32f
Todos
pepyakin 525df4b
Refund even if top-level contract fails.
pepyakin 8562de6
Fix error msg
pepyakin 4122f48
Fix caller issue
pepyakin f9497dd
Extract tests module
pepyakin 7bf7759
Add max_depth var in storage
pepyakin de095a6
Remove left over gas_left
pepyakin 338fe9f
Refactor exec
pepyakin 4377497
Add test oog test.
pepyakin 8ce5aed
set_free_balance_creating
pepyakin d8fa9e4
Docs and comments.
pepyakin a1ecfb0
Merge 'origin/master' into ser-contract-ioc
pepyakin 91371c9
Update storage roots because of ContractFee move
pepyakin 4dfc7dc
Rebuild binaries.
pepyakin 2348c18
Simplify vm code.
pepyakin 5873335
Wrapping.
pepyakin 62b498d
Refactor a bit.
pepyakin 895386d
Typo
pepyakin 3e92676
UpdateBalanceOutcome enum
pepyakin ee97b9e
Style grumbles.
pepyakin 34189ee
Merge 'origin/master' into ser-contract-ioc
pepyakin a18292a
Rebuild binaries.
pepyakin 81e6eb7
Always consume the given amount of gas.
pepyakin 9a52a44
[skip ci] endownment → endowment
pepyakin d91dfbe
Rename `AccountId` generic in on_account_kill
pepyakin ee83701
Merge branch 'master' into ser-contract-ioc
pepyakin f570351
Fix Cargo.lock
pepyakin 4de767b
Refine docs for gas meter.
pepyakin 58878a8
[skip ci] Add comments for gas module
pepyakin 7a712e1
Merge branch 'master' into ser-contract-ioc
pepyakin eeebaba
Directly assign to `return_data` at declaration
pepyakin 595e534
Use slices instead of vecs to pass the input data
pepyakin a846bb1
Add todo about passing return data without copy
pepyakin 3afe59a
Use checked_add instead of add with overflow
pepyakin dae4d40
Use return_data directly.
pepyakin 9e13c68
Rebuild binaries.
pepyakin d6c6250
Merge 'origin/master' into ser-contract-ioc
pepyakin af99a9d
Rebuild binaries.
pepyakin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rename buy_gas
- Loading branch information
commit 5bd0ee9be54ec1d4495f152ff66d76d3f1ade0a1
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this used? needs a doc comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok looks like it's just call/create. should probably be a little more restricted, like
pub(crate)or somethingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, and it isn't exported.
There are quite a few places which relies on the fact they are declared in a not public sub-module. E.g.:
pub struct GasMeter,pub enum GasMeterResultor bunch of others in other modules (e.g.account_db::AccountDb).Should I change them as well?