This repository was archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Spec with tested Morden genesis decoder and builtins. #54
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
957dd36
Make builtins work.
gavofyork e369042
Correct naming and fix for Morden.
gavofyork dabb90b
Fix tests for builtin.
gavofyork 6585910
Whitespace fixes.
gavofyork e98452b
Tests for Builtin.
gavofyork db23ee7
Fixes and a test! Now correctly builds Morden's genesis block.
gavofyork 799da83
Merge remote-tracking branch 'origin/master' into gav
gavofyork f9b3e26
Fix warnings.
gavofyork 810bff1
Morden genesis tested and working.
gavofyork 14d77d5
Minor whitespacing.
gavofyork 3cb3c2a
Fix for Genesis.
gavofyork 183682f
ecrecover builtin, tests and docs.
gavofyork 8f4637e
API sync (moved Populatable to util).
gavofyork d94fcbd
sha256 builtin + tests.
gavofyork 7e873a8
ripemd160 builtin and tests.
gavofyork e6439dd
Minor API update.
gavofyork 6837899
Fixups for new bytes.rs API.
gavofyork 648207d
Rename fax->copy.
gavofyork 3cbaf64
Beginnings of Ethash engine.
gavofyork 1c71640
Build fixes for Ethash.
gavofyork 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
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,34 @@ | ||
| { | ||
| "engineName": "Ethash", | ||
| "params": { | ||
| "accountStartNonce": "0x0100000", | ||
| "frontierCompatibilityModeLimit": "0xfffa2990", | ||
| "maximumExtraDataSize": "0x20", | ||
| "tieBreakingGas": false, | ||
| "minGasLimit": "0x1388", | ||
| "gasLimitBoundDivisor": "0x0400", | ||
| "minimumDifficulty": "0x020000", | ||
| "difficultyBoundDivisor": "0x0800", | ||
| "durationLimit": "0x0d", | ||
| "blockReward": "0x4563918244F40000", | ||
| "registrar": "", | ||
| "networkID" : "0x2" | ||
| }, | ||
| "genesis": { | ||
| "nonce": "0x00006d6f7264656e", | ||
| "difficulty": "0x20000", | ||
| "mixHash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", | ||
| "author": "0x0000000000000000000000000000000000000000", | ||
| "timestamp": "0x00", | ||
| "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
| "extraData": "0x", | ||
| "gasLimit": "0x2fefd8" | ||
| }, | ||
| "accounts": { | ||
| "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "linear": { "base": 3000, "word": 0 } } }, | ||
| "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "linear": { "base": 60, "word": 12 } } }, | ||
| "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "linear": { "base": 600, "word": 120 } } }, | ||
| "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "linear": { "base": 15, "word": 3 } } }, | ||
| "102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" } | ||
| } | ||
| } |
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
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,22 @@ | ||
| use engine::Engine; | ||
| use spec::Spec; | ||
| use evm_schedule::EvmSchedule; | ||
| use env_info::EnvInfo; | ||
|
|
||
| /// Engine using Ethash proof-of-work consensus algorithm, suitable for Ethereum | ||
| /// mainnet chains in the Olympic, Frontier and Homestead eras. | ||
| pub struct Ethash { | ||
| spec: Spec, | ||
| } | ||
|
|
||
| impl Ethash { | ||
| pub fn new_boxed(spec: Spec) -> Box<Engine> { | ||
| Box::new(Ethash{spec: spec}) | ||
| } | ||
| } | ||
|
|
||
| impl Engine for Ethash { | ||
| fn name(&self) -> &str { "Ethash" } | ||
| fn spec(&self) -> &Spec { &self.spec } | ||
| fn evm_schedule(&self, _env_info: &EnvInfo) -> EvmSchedule { EvmSchedule::new_frontier() } | ||
| } |
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
Oops, something went wrong.
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.
we shouldn't hardcode paths. It's better to use
.cargo/configand overwrite paths only locally.eg.
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.
For some reason that causes a trip to crates.io and recompilation on each cargo build. A considerable slowdown