-
Notifications
You must be signed in to change notification settings - Fork 1
ADR #0012: Initial Precompiles #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
khssnv
wants to merge
7
commits into
main
Choose a base branch
from
khssnv/adr-initial-precompiles
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8526028
Init ADR #0012: Initial Precompiles
khssnv 15745a9
Initial precompiles ideas
khssnv 29d1635
Update docs/ADR/0012-initial-precompiles.md
khssnv ebb052c
Add advised options
khssnv c8ce07c
Typo fix
khssnv d3f11fd
Add `pallet-preimage` precompile
khssnv 38deee8
Add randomness precompile options
khssnv 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
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
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,107 @@ | ||||||||||||||
# ADR_0012: Initial Precompiles | ||||||||||||||
|
||||||||||||||
## Date | ||||||||||||||
|
||||||||||||||
Decision date: YYYY-MM-DD | ||||||||||||||
Last status update: YYYY-MM-DD | ||||||||||||||
|
||||||||||||||
## Status | ||||||||||||||
|
||||||||||||||
- [x] Proposed | ||||||||||||||
- [ ] Accepted | ||||||||||||||
- [ ] Deprecated | ||||||||||||||
- [ ] Superseded | ||||||||||||||
|
||||||||||||||
### Implementation Status | ||||||||||||||
|
||||||||||||||
- [x] Planned | ||||||||||||||
- [ ] In Development | ||||||||||||||
- [ ] Implemented | ||||||||||||||
- [ ] Verified | ||||||||||||||
- [ ] Discontinued | ||||||||||||||
|
||||||||||||||
## People | ||||||||||||||
|
||||||||||||||
### Author/Decision Owner | ||||||||||||||
|
||||||||||||||
- Alisher Khassanov, [@khssnv](https://github.com/khssnv) | ||||||||||||||
|
||||||||||||||
### Consulted | ||||||||||||||
|
||||||||||||||
### Informed | ||||||||||||||
|
||||||||||||||
## Decision | ||||||||||||||
|
||||||||||||||
We will create a set of initial precompiles for the smart contracts platform. | ||||||||||||||
|
||||||||||||||
## Options | ||||||||||||||
|
||||||||||||||
### Option 1: [Name of option] (SELECTED) | ||||||||||||||
|
||||||||||||||
[Brief description of this option.] | ||||||||||||||
|
||||||||||||||
**Selected because:** | ||||||||||||||
|
||||||||||||||
- [Benefit 1 that led to selection] | ||||||||||||||
- [Benefit 2 that led to selection] | ||||||||||||||
|
||||||||||||||
**Selected despite:** | ||||||||||||||
|
||||||||||||||
- [Drawback 1 that we accept] | ||||||||||||||
- [Drawback 2 that we accept] | ||||||||||||||
|
||||||||||||||
**Risks and Mitigations:** | ||||||||||||||
|
||||||||||||||
- [Risk 1] | ||||||||||||||
- [Mitigation strategy 1] | ||||||||||||||
- [Risk 2] | ||||||||||||||
- [Mitigation strategy 2] | ||||||||||||||
|
||||||||||||||
**Failure Recovery:** | ||||||||||||||
[How will we recover if this option fails?] | ||||||||||||||
|
||||||||||||||
### Option 2: Expose governance functionality to smart contracts | ||||||||||||||
|
||||||||||||||
See <https://github.com/paritytech/polkadot-sdk/issues/8366>. | ||||||||||||||
|
||||||||||||||
**Rejected because:** | ||||||||||||||
|
||||||||||||||
- Implementation already taken by Polkadot Technical Fellowship member. | ||||||||||||||
|
||||||||||||||
**Rejected despite:** | ||||||||||||||
|
||||||||||||||
- [Potential benefit 1 we're giving up] | ||||||||||||||
- [Potential benefit 2 we're giving up] | ||||||||||||||
|
||||||||||||||
### Option 3: ERC721, ERC1155 for `pallet-nfts` | ||||||||||||||
|
||||||||||||||
**Rejected because:** | ||||||||||||||
|
||||||||||||||
- Not related to QF Network priorities. | ||||||||||||||
|
||||||||||||||
### Option 4: Utility pallets interface | ||||||||||||||
|
||||||||||||||
- `pallet-scheduler` for scheduling runtime calls to occur at a specified block number or at a specified period. | ||||||||||||||
- `pallet-multisig` to access existing multisig functionality from a smart contract. | ||||||||||||||
- `pallet-indices` for smart contracts to be able to use short form address. | ||||||||||||||
|
||||||||||||||
### Option 5: XCM precompile | ||||||||||||||
|
||||||||||||||
- Proxy to Ethereum smart contracts. Data availability restrictions. | ||||||||||||||
|
||||||||||||||
## Advice (Optional) | ||||||||||||||
|
||||||||||||||
[Raw, unfiltered contributions from people who offered advice. his section provides transparency into the decision process and serves as a learning resource.] | ||||||||||||||
|
||||||||||||||
- [Advice given] ([Advice-giver's name, role], YYYY-MM-DD) | ||||||||||||||
- [Advice given] ([Advice-giver's name, role], YYYY-MM-DD) | ||||||||||||||
|
||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
## Glossary | ||||||||||||||
|
||||||||||||||
- **Precompile**: runtime function available to smart contracts via a cross-contract call. | ||||||||||||||
|
||||||||||||||
## References | ||||||||||||||
|
||||||||||||||
- Revive project review, <https://coda.io/d/_df6rzXCWZj8/Revive-project-review_suwtiLjr>. | ||||||||||||||
- How precompiles work, <https://coda.io/d/QF-Network_df6rzXCWZj8/How-precompiles-work_supZxHtN>. | ||||||||||||||
- Governance for modifying precompiles set, <https://coda.io/d/_df6rzXCWZj8/Governance-for-modifying-precompiles-set_suEXoFy->. |
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.
Uh oh!
There was an error while loading. Please reload this page.