-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
Co-Authored-By: David <[email protected]>
Add remaining test vectors
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.
Looks good 😎
Co-Authored-By: Andronik Ordian <[email protected]>
Co-Authored-By: Andronik Ordian <[email protected]>
Return a cost of u32::MAX if conversion fails Fix docs and todos
Co-Authored-By: Niklas Adolfsson <[email protected]>
Co-Authored-By: Andronik Ordian <[email protected]>
Co-Authored-By: Andronik Ordian <[email protected]>
…:paritytech/parity-ethereum into dp/feature/eip-152-add-blake2-precompile * 'dp/feature/eip-152-add-blake2-precompile' of github.com:paritytech/parity-ethereum: Update json/src/spec/builtin.rs Update json/src/spec/builtin.rs Update util/EIP-152/src/lib.rs
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.
LGTM
Let's not merge this PR before I say so. There are problems with the EIP being discussed in the gitter and until we know what is going to happen we're better off not merging this. |
It was decided on ACD on friday that nothing changes on the implementation: ethereum/EIPs#152 (comment) .
Please get this merged so we can kick off cross-client testing. Btw: did you guys implement |
* master: fix: remove unused error-chain (#11028) fix: remove needless use of itertools (#11029) Convert `std::test` benchmarks to use Criterion (#10999) Fix block detail updating (#11015) [trace] introduce trace failed to Ext (#11019) cli: update usage and version headers (#10924) [private-tx] remove unused rand (#11024)
ethcore/builtin/src/lib.rs
Outdated
// 1. immutable, | ||
// 2. comprised of `u64` | ||
// …and because we're using the (known) length of `h` | ||
slice::from_raw_parts(h.as_ptr() as *const u8, h.len() * size_of::<u64>()) |
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.
It might be better to remove this unsafe. What I worry is someone compiling parity-ethereum to a big endian platform. There may not be many, but once people do that it breaks consensus. We may want to just specify the exact encoding how conversion from u64 array to bytearray happens.
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.
There could be other problems with big endian, e.g. with ethash https://github.com/paritytech/parity-ethereum/blob/5baa7e8fb50512b0de11b0994fa1b136de289831/ethash/src/compute.rs#L273-L276
but in this case it should work with big endian if I'm not mistaken
…he-right-place * master: cleanup json crate (#11027) [spec] add istanbul test spec (#11033) [json-spec] make blake2 pricing spec more readable (#11034) Add blake2_f precompile (#11017) Add new line after writing block to hex file. (#10984) fix: remove unused error-chain (#11028) fix: remove needless use of itertools (#11029) Convert `std::test` benchmarks to use Criterion (#10999) Fix block detail updating (#11015) [trace] introduce trace failed to Ext (#11019) cli: update usage and version headers (#10924) [private-tx] remove unused rand (#11024)
* feat: implement eip1108 * doc nit: price per point pair Co-Authored-By: David <[email protected]> * fix: test-build * fix: update chain specs * fix: basic_authority.json chain spec * fix: change `eip_transition == 0x7fffffffffffff` * Merge na-eip1108 * Pre-compile plumbing * Use type alias instead of struct * Extract the data from incoming EVM call and forward it to blake2_f * Fetch parity-common from git for now * Fix broken cost impl Add remaining test vectors * cleanup * Trailing comma in json spec * Update ethcore/builtin/src/lib.rs Co-Authored-By: Andronik Ordian <[email protected]> * Update ethcore/builtin/src/lib.rs Co-Authored-By: Andronik Ordian <[email protected]> * Rename pricer to be Blake2-specific Return a cost of u32::MAX if conversion fails Fix docs and todos * Fix error handling in cost() * fix chainspec * EIP-152 crate * Update ethcore/builtin/src/lib.rs Co-Authored-By: Seun LanLege <[email protected]> * Address grumbles * Update ethcore/builtin/src/lib.rs Co-Authored-By: Niklas Adolfsson <[email protected]> * Switch tests to use hex! * remove parity-crypto from git * Sort out the SIGMA * Prefer arrays to vecs * Update util/EIP-152/src/lib.rs Co-Authored-By: Niklas Adolfsson <[email protected]> * Update json/src/spec/builtin.rs Co-Authored-By: Andronik Ordian <[email protected]> * Update json/src/spec/builtin.rs Co-Authored-By: Andronik Ordian <[email protected]> * Review feedback * Do not change chainspecs yet * Do not assume endianess: precompile output is LE
* feat: implement eip1108 * doc nit: price per point pair Co-Authored-By: David <[email protected]> * fix: test-build * fix: update chain specs * fix: basic_authority.json chain spec * fix: change `eip_transition == 0x7fffffffffffff` * Merge na-eip1108 * Pre-compile plumbing * Use type alias instead of struct * Extract the data from incoming EVM call and forward it to blake2_f * Fetch parity-common from git for now * Fix broken cost impl Add remaining test vectors * cleanup * Trailing comma in json spec * Update ethcore/builtin/src/lib.rs Co-Authored-By: Andronik Ordian <[email protected]> * Update ethcore/builtin/src/lib.rs Co-Authored-By: Andronik Ordian <[email protected]> * Rename pricer to be Blake2-specific Return a cost of u32::MAX if conversion fails Fix docs and todos * Fix error handling in cost() * fix chainspec * EIP-152 crate * Update ethcore/builtin/src/lib.rs Co-Authored-By: Seun LanLege <[email protected]> * Address grumbles * Update ethcore/builtin/src/lib.rs Co-Authored-By: Niklas Adolfsson <[email protected]> * Switch tests to use hex! * remove parity-crypto from git * Sort out the SIGMA * Prefer arrays to vecs * Update util/EIP-152/src/lib.rs Co-Authored-By: Niklas Adolfsson <[email protected]> * Update json/src/spec/builtin.rs Co-Authored-By: Andronik Ordian <[email protected]> * Update json/src/spec/builtin.rs Co-Authored-By: Andronik Ordian <[email protected]> * Review feedback * Do not change chainspecs yet * Do not assume endianess: precompile output is LE
* add more tx tests (#11038) * Fix parallel transactions race-condition (#10995) * Add blake2_f precompile (#11017) * [trace] introduce trace failed to Ext (#11019) * Edit publish-onchain.sh to use https (#11016) * Fix deadlock in network-devp2p (#11013) * EIP 1108: Reduce alt_bn128 precompile gas costs (#11008) * xDai chain support and nodes list update (#10989) * EIP 2028: transaction gas lowered from 68 to 16 (#10987) * EIP-1344 Add CHAINID op-code (#10983) * manual publish jobs for releases, no changes for nightlies (#10977) * [blooms-db] Fix benchmarks (#10974) * Verify transaction against its block during import (#10954) * Better error message for rpc gas price errors (#10931) * Fix fork choice (#10837) * Fix compilation on recent nightlies (#10991)
* add more tx tests (#11038) * Fix parallel transactions race-condition (#10995) * Add blake2_f precompile (#11017) * [trace] introduce trace failed to Ext (#11019) * Edit publish-onchain.sh to use https (#11016) * Fix deadlock in network-devp2p (#11013) * EIP 1108: Reduce alt_bn128 precompile gas costs (#11008) * xDai chain support and nodes list update (#10989) * EIP 2028: transaction gas lowered from 68 to 16 (#10987) * EIP-1344 Add CHAINID op-code (#10983) * manual publish jobs for releases, no changes for nightlies (#10977) * [blooms-db] Fix benchmarks (#10974) * Verify transaction against its block during import (#10954) * Better error message for rpc gas price errors (#10931) * tx-pool: accept local tx with higher gas price when pool full (#10901) * Fix fork choice (#10837) * Cleanup unused vm dependencies (#10787) * Fix compilation on recent nightlies (#10991)
* master: (70 commits) ethcore: remove `test-helper feat` from build (#11047) Include test-helpers from ethjson (#11045) [ethcore]: cleanup dependencies (#11043) add more tx tests (#11038) Fix parallel transactions race-condition (#10995) [ethcore]: make it compile without `test-helpers` feature (#11036) Benchmarks for block verification (#11035) Move snapshot related traits to their proper place (#11012) cleanup json crate (#11027) [spec] add istanbul test spec (#11033) [json-spec] make blake2 pricing spec more readable (#11034) Add blake2_f precompile (#11017) Add new line after writing block to hex file. (#10984) fix: remove unused error-chain (#11028) fix: remove needless use of itertools (#11029) Convert `std::test` benchmarks to use Criterion (#10999) Fix block detail updating (#11015) [trace] introduce trace failed to Ext (#11019) cli: update usage and version headers (#10924) [private-tx] remove unused rand (#11024) ...
As per EIP 152, adds a new precompile at
0x09
to expose the Blake2 compression function, aka the "F function".Spec: https://tools.ietf.org/html/rfc7693#section-3.2
EIP-152: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md
Closes #10994
Note: the F compression function in this PR is not optimised (or rather, it's optimised for readability ;). This will be addressed in a separate PR as the intention here is to be 1. spec compliant and 2. get the precompile plumbing in place.
Note-2: The chainspecs are not yet updated a part from
foundation.json
. Would appreciate a review of the format used there and I'll replicate it elsewhere.