-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add EVM Engine and Rust libs #1815
Merged
Merged
Conversation
This file contains 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
dcorral
reviewed
Mar 27, 2023
dcorral
reviewed
Mar 27, 2023
dcorral
reviewed
Mar 27, 2023
* Add context calls for EVM block creation * Add update_state bool * Add context discard * Return vector of vectors * Vector of vectors unsupported * Add EVM context to ConnectBlock * Add TransactionQueueMap and rough finalize_block * Add EVM header to coinbase * Add call to get key from wallets * Send encoded block header * Remove evm_add_balance dummy call * Remove comment * Fix tests --------- Co-authored-by: Bushstar <bushsolo@gmail.com>
* Make handlers extensible, add block handler * Move EVMHandler * Fix build errors * Add connect_block * Fix Eth_GetBlockByHash * Fix incomplete merge * Add bin files to gitignore * Change RPC methods to lowerCamelCase * Formatting
* Return error on sub balance failure. * Change to expected return type * Update EVM in/out TX * Use array instead of rust::Vec * Pass context to CustomTxVisit * Add temporary state to TransactionQueue * Improve readability * Block integration test --------- Co-authored-by: Bushstar <bushsolo@gmail.com> Co-authored-by: Prasanna Loganathar <pvl@prasannavl.com>
* Return error on sub balance failure. * Change to expected return type * Update EVM in/out TX * Use array instead of rust::Vec * Pass context to CustomTxVisit * Add temporary state to TransactionQueue * Improve readability * Block integration test --------- Co-authored-by: Bushstar <bushsolo@gmail.com>
* Got correct hash for public key recovery. Add test. * Add support for EIP1559 TXs address recovery * Add support for EIP2930 TXs address recovery * Add failing test
* Improve error handling * Correct test addresses
* Get correct hash for public key recovery. Add test. * Update test for EIP-2930
* Add smart contract create && call tests
* add ci for evm * toolchain nightly will do * add cargo clippy ci * Add EVM BlockHandler (#1864) * Make handlers extensible, add block handler * Move EVMHandler * Fix build errors * Add connect_block * Fix Eth_GetBlockByHash * Fix incomplete merge * Add bin files to gitignore * Change RPC methods to lowerCamelCase * Formatting * EVM in/out refinements (#1865) * Return error on sub balance failure. * Change to expected return type * Update EVM in/out TX * Use array instead of rust::Vec * Pass context to CustomTxVisit * Add temporary state to TransactionQueue * Improve readability * Block integration test --------- Co-authored-by: Bushstar <bushsolo@gmail.com> Co-authored-by: Prasanna Loganathar <pvl@prasannavl.com> * Revert "EVM in/out refinements (#1865)" (#1867) This reverts commit 35c85d4. * EVM in/out refinements (#1868) * Return error on sub balance failure. * Change to expected return type * Update EVM in/out TX * Use array instead of rust::Vec * Pass context to CustomTxVisit * Add temporary state to TransactionQueue * Improve readability * Block integration test --------- Co-authored-by: Bushstar <bushsolo@gmail.com> * Fix warnings (#1869) * Got correct hash for public key recovery. Add test. (#1870) * Got correct hash for public key recovery. Add test. * Add support for EIP1559 TXs address recovery * Add support for EIP2930 TXs address recovery * Add failing test * Improve error handling (#1872) * Improve error handling * Correct test addresses * Fix public key extraction from Eth TXs and add tests (#1875) * Get correct hash for public key recovery. Add test. * Update test for EIP-2930 * EVM block integration test (#1874) * Add smart contract create && call tests * evm ci event triggered by path * fmt --------- Co-authored-by: Shoham Chakraborty <shhmchk@gmail.com> Co-authored-by: Jouzo <15011228+Jouzo@users.noreply.github.com> Co-authored-by: Bushstar <bushsolo@gmail.com> Co-authored-by: Prasanna Loganathar <pvl@prasannavl.com>
* eth_call from and to are mandatory field * expose evm ExitReason and ExitSucceed * add should_call_evm test * add should_call test * add should_get_balance test * rm println and unuse assert * fix tests * fmt
* revert from,to to optional in ethtxinfo * fmt
* Do auth on EvmOut wtih DFI equivalent * Add authorization for EvmOut with equivalent DFI address of ETH address
* Store ethereum blocks in BlockManager * Update ffi call * eth_blockNumber and eth_getBlockByCount implementations * formatting * Fix hanging * Fix RPC names and output * Format * Fix test * Fix tests * Fix logic * Remove explicit drop * Fix hash outputs, add test * Syntax improvements
* Install solc from make.sh * Add pkg_install_solc to ci_setup_deps * Install web3.py in make.sh
…feature/evm' of github.com:DeFiCh/ain into feature/evm
* Fix block 0 generation * Formatting * Remove unused imports
* Refactor transferdomain message and rpc * Add test for multiple transfer and mixed transfers * Add comment note * Squashed commit of the following: commit 9cc4f21 Author: Peter John Bushnell <bushsolo@gmail.com> Date: Wed Jun 7 08:21:57 2023 +0100 Move EVM state changes to outside Connect/DisconnectBlock (#2032) * Demo work in progress code * Add iter method to keep transaction in queue instead of draining * Remove print from test * Rename iter to get_cloned_vec * Use get_cloned_vec * Update code after merge --------- Co-authored-by: jouzo <jdesclercs@gmail.com> commit bba09e5 Author: Peter John Bushnell <bushsolo@gmail.com> Date: Wed Jun 7 06:52:30 2023 +0100 Include EVM mnview in rollback. Convert miner fee to Sats. (#1999) * Convert miner fee to Sats * Move evm_finalize to ProcessDefi and include mnview changes in rollback commit 3208586 Author: canonbrother <w.canonbrother@gmail.com> Date: Wed Jun 7 11:10:04 2023 +0800 refactor(workflows): move `./scripts/fixtures.sh` to `.github` (#2030) * move scripts/fixtures.sh to .github * update bob addr to checksum addr commit 571ae53 Author: Shoham Chakraborty <shhmchk@gmail.com> Date: Tue Jun 6 18:42:42 2023 +0800 evm: Support contracts in functional tests (#2023) * Add contract compilation and interaction to Python tests * Fix path * Clean up test * Change function name * Refactor to EVMProvider and KeyPair * Move files to test_framework * Add EVMProvider to TestNode * Add static from_node method to KeyPair * Add static from_file method to EVMContract * Add static from_node method to EVMProvider * Remove web3 checksum * Strip out validation of transferdomain as pure functions. * Fix conversion * Fix rpc command * Update tests for new TransferDomain values --------- Co-authored-by: Prasanna Loganathar <pvl@prasannavl.com> Co-authored-by: Peter Bushnell <bushsolo@gmail.com>
* Add Eth addresses to getaccount * Output tokens in order * Revert test framework option scans --------- Co-authored-by: Prasanna Loganathar <pvl@prasannavl.com>
* Return nonce on evm_prevalidate_raw_tx * Catch thrown error from evm_prevalidate_raw_tx * Returns sender address in evm_prevalidate_raw_tx * Check if nonce is the expected value * Get evm nonce and balance at latest block height * With RustRes instead of throw * Use RustRes in evm_try_queue_tx * Parse metadata into txMessage * Add evm_get_nonce_in_context FFI method * Document TransactionQueue nonce handling * Return InvalidNonce if queued nonce is not in increasing order * Add unit test for nonce order * Use FFI evm_get_nonce_in_context * Get the next valid nonce * Track failed nonces and try them once other TXs are added * Prevalidate all TXs with nonce > account nonce * Test transactions added in order * Time order mempool TXs * Remove commented out gas check in validate raw tx * Add more EVM TXs for test --------- Co-authored-by: Peter Bushnell <bushsolo@gmail.com>
* Discourage sending to Eth address on account layer * Remove unused function and add test
* Deduct fee from sender * Prevalidate balance for MIN_GAS_PER_TX * Additional check to prevalidate tx and tests
* Fix block gas limit * Fix build * Add base_fee_per_gas to block output * Formatting * Calculate base fee * Save base fee map * eth_feeHistory implementation * Formatting * Fix block_count type, remove debug param * Fix build * Implement eth_maxPriorityFeePerGas * Fix suggested_priority_fee loop * Address issues * Increase initial base fee, set minimum base fee, fix feeHistory output order * Refactor to use match * Use EIP1559 for eth_gasPrice estimation
* Set trie state and get new state root from JSON * Load state from input JSON * Store genesis block after loading state from json * Remove panic and document handlers initialization * Add warning * Add debug log * WIP BLOCK --------- Co-authored-by: jouzo <jdesclercs@gmail.com>
* Set max gas limit per block * Send used gas to miner in evm_prevalidate_raw_tx * Rename to used_gas * Get used gas from FFI * Do not add failed TX gas to total * Optional prevalidation of TX gas usage --------- Co-authored-by: jouzo <jdesclercs@gmail.com>
This was referenced Jun 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implications
Index changes
Consensus