Skip to content
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

Feature : IL-Evm Optimization #6985

Draft
wants to merge 177 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
49215cd
branch preparations
Demuirgos Nov 12, 2023
1c8dfe7
minor amedments and moving pieces
Scooletz Nov 13, 2023
db5484c
moving pieces
Scooletz Nov 14, 2023
aeaabef
Merge remote-tracking branch 'origin/master' into feature/IL-EVM
Demuirgos Dec 14, 2023
20812f2
fix build issue
Demuirgos Dec 14, 2023
6943d6c
add naive analyzer for testing
Demuirgos Dec 15, 2023
c7c951f
Added placeholder tests
Demuirgos Dec 16, 2023
52ee53b
simplification
Scooletz Jan 15, 2024
e1ea81e
Merge branch 'master' into feature/IL-EVM
Scooletz Jan 15, 2024
8e47c0b
shorcircuit one path
Scooletz Jan 15, 2024
371e13f
merge master resolve conflicts
Demuirgos Feb 29, 2024
4520761
added more tests and refactors
Demuirgos Feb 29, 2024
8c25759
Merge changes
Demuirgos Feb 29, 2024
a9ee5f7
segmented pure code sections, in prepration for attempting IL weavin…
Demuirgos Mar 5, 2024
1e44612
simple prototype building on old IL-VM branch [WIP]
Demuirgos Mar 14, 2024
1a2d3a6
more experimentation with IL-emition
Demuirgos Mar 15, 2024
6a7a7c6
more opcodes added
Demuirgos Mar 15, 2024
ac87337
refactor + merge master
Demuirgos Mar 20, 2024
95500d8
minor changes
Demuirgos Mar 20, 2024
41d7bfe
[wip] sigil-ify the code
Demuirgos Mar 21, 2024
0dd5fc0
sigli-fy the current progress
Demuirgos Mar 21, 2024
3352ad1
ported jumptable from old IL-EVM branch
Demuirgos Mar 25, 2024
1ea0d34
minor refactors and code changes
Demuirgos Mar 26, 2024
8ef208f
add test to keep track of emitable opcodes coverage
Demuirgos Mar 27, 2024
99b3e19
context swap (wip)
Demuirgos Apr 17, 2024
11768f6
minor changes
Demuirgos May 1, 2024
5e5c0bb
fix build issue : Signature mismatch in ILAnalyzer
Demuirgos May 6, 2024
2313608
refactored code : to analyze in stages instead of at once
Demuirgos May 6, 2024
010f5e5
refactors and fixes [WIP]
Demuirgos May 7, 2024
d21a2f5
Refactors, and added some tests
Demuirgos May 9, 2024
c9e9bd7
Added some comments
Demuirgos May 12, 2024
c5076fa
BoilerPlate for more opcodes
Demuirgos May 12, 2024
545b0fa
dynamic emited method works, more bugs to hunt for
Demuirgos May 14, 2024
bee1d82
notes
Demuirgos May 14, 2024
760f481
exception code generation refactor
Demuirgos May 15, 2024
a6aa032
bug fixes and refactors
Demuirgos May 16, 2024
04ff54c
Added memory opcodes initial implementation
Demuirgos May 18, 2024
4700d7a
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos May 18, 2024
251db24
minor refactor and bug fixes
Demuirgos May 21, 2024
1abc3dd
optimized away some flaws, refactored code, and more bug fixes
Demuirgos May 23, 2024
3ad1147
changed immediate data handling
Demuirgos May 23, 2024
a6df2d7
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos May 23, 2024
32eabdc
minor refactors
Demuirgos May 23, 2024
84e9c15
- bug fixes in Memory opcodes
Demuirgos May 28, 2024
0117d21
added draft implementation of more opcodes, needs verification
Demuirgos May 29, 2024
6990d82
added drafts for shift opcodes
Demuirgos May 29, 2024
4e8d008
minor fix
Demuirgos May 29, 2024
07864f7
added more opcode
Demuirgos May 30, 2024
8f1a98e
added support for the *MOD opcodes
Demuirgos May 30, 2024
32c2e60
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos May 30, 2024
b5ee26d
Added more opcodes
Demuirgos May 30, 2024
84cf07d
- Added more opcodes
Demuirgos Jun 3, 2024
3779113
Minor fixes and refactor
Demuirgos Jun 4, 2024
f6336b4
Merge Master
Demuirgos Jun 4, 2024
5a55b3b
fix bug in JUMPI and jumpdest handling, plust extra fixes and refactors
Demuirgos Jun 9, 2024
26b6287
fix jumpdest emition
Demuirgos Jun 10, 2024
4922f1b
Added a work-around to cross segment jumps inside IL
Demuirgos Jun 21, 2024
5216592
fix build issue
Demuirgos Jun 21, 2024
4610a2e
merge master
Demuirgos Jul 24, 2024
05a0fd4
* Expose EvmState in ILEvmState struct
Demuirgos Jul 24, 2024
d8c824f
* Expose IWorldState to ILEVM
Demuirgos Jul 26, 2024
2c53a5b
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Jul 26, 2024
d2b0951
* draft implementation for TSTORE/TLOAD
Demuirgos Jul 26, 2024
65821c6
* fix some failing tests
Demuirgos Jul 27, 2024
44c1f4a
* fix TSTORE/TLOAD
Demuirgos Jul 27, 2024
aa05c83
* fix EXTCODE* opcodes
Demuirgos Jul 28, 2024
e5a2e64
* Added Balance and SELFBALANCE opcodes
Demuirgos Jul 29, 2024
2660e28
* Add stack underflow / overflow checks
Demuirgos Jul 30, 2024
384a614
Merge master
Demuirgos Aug 21, 2024
e399afa
* Added opcode Enabled check
Demuirgos Aug 26, 2024
3e86010
LOG Instructions (#7290)
SiddharthV1 Aug 26, 2024
7dab2ea
* adding IConfig to VirtualMachine
Demuirgos Aug 26, 2024
0a24ffe
* adding IVmConfig to INethermindApi Interface
Demuirgos Aug 26, 2024
af48bc9
* fix pattern dictionary having wrong key
Demuirgos Aug 27, 2024
ae507b0
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Aug 27, 2024
152383a
* fix whitespace
Demuirgos Aug 27, 2024
b54f4b2
* Added InvalidJump exception
Demuirgos Aug 28, 2024
b115862
* exposed IWorldState inside of chunkcs interface
Demuirgos Aug 28, 2024
b76544e
* fix whitespace format
Demuirgos Aug 28, 2024
0628912
* Added gas cost to chunks
Demuirgos Aug 29, 2024
fa2e265
* refactors and more tests
Demuirgos Aug 30, 2024
de174e3
Added more tests, fixed indexing bugs, fixed stack size inconsistencies
Demuirgos Sep 2, 2024
e5b1cc1
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Sep 2, 2024
69bd550
fix build issue
Demuirgos Sep 3, 2024
13239e5
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Sep 3, 2024
7b265d9
minor changes to ILVMTracer interface
Demuirgos Sep 3, 2024
06f4bbf
* fix cross segment jumps
Demuirgos Sep 4, 2024
77a0345
fix endianness issue in StoreField
Demuirgos Sep 6, 2024
0f32924
fix build issue
Demuirgos Sep 6, 2024
9a8a73b
fix nullptr exception error
Demuirgos Sep 6, 2024
bd9c05f
fix failing tests
Demuirgos Sep 6, 2024
187df41
* Adding Hash as Id to segment names (may revert)
Demuirgos Sep 6, 2024
19b0063
Aletered tracing mechanism
Demuirgos Sep 9, 2024
2a2c0fc
fix build issues
Demuirgos Sep 10, 2024
371057a
* Fixed issue
Demuirgos Sep 23, 2024
47e6c13
Merge master
Demuirgos Sep 23, 2024
4c62e61
fix ws
Demuirgos Sep 23, 2024
661e74a
modify tests parameters
Demuirgos Sep 23, 2024
60fd1bd
merge master
Demuirgos Sep 24, 2024
6e744c2
fix bugs
Demuirgos Sep 25, 2024
77c33a2
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Sep 25, 2024
20a0d50
fixed failing tests (EXP, Pattern)
Demuirgos Sep 26, 2024
8e42438
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Sep 26, 2024
ee86b49
ws fixes
Demuirgos Sep 26, 2024
bf59fd0
- Added pattern addition in Initialize blockchain
Demuirgos Sep 27, 2024
2f2f562
only add patterns if IlvmPatternMode is activated
Demuirgos Sep 27, 2024
95631cc
moved stack checks happen before attempting pop/push
Demuirgos Sep 27, 2024
9f3b645
remove ammotised gas cost for now
Demuirgos Sep 27, 2024
ea38379
updated tests
Demuirgos Oct 1, 2024
dc9bc3a
merge master, and fix merge conflicts
Demuirgos Oct 1, 2024
dc2752f
format whitespace
Demuirgos Oct 1, 2024
da2343e
fix GAS opcode
Demuirgos Oct 1, 2024
d65166b
Added Logging
Demuirgos Oct 1, 2024
b0fc788
Added some fields in Metrics API
Demuirgos Oct 2, 2024
d6a593b
fx whitespace formatting
Demuirgos Oct 2, 2024
d92fc06
fix test pattern implimentation
Demuirgos Oct 2, 2024
4246e5d
various fixes
Demuirgos Oct 8, 2024
95b5a4a
Merge master,resolve conflicts
Demuirgos Oct 8, 2024
77daef5
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Oct 11, 2024
ee48674
* added cross segment jumping
Demuirgos Oct 12, 2024
8bf6337
ws fixes
Demuirgos Oct 12, 2024
78501d4
updated tests
Demuirgos Oct 13, 2024
dbdeb62
- fixed tests : clear code cache and run test sequencially
Demuirgos Oct 15, 2024
42e78a9
Top opcode patterns (#7597)
SiddharthV1 Oct 15, 2024
2a2b37b
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Oct 15, 2024
5098c88
Added single opcode tracing mode to ILVM
Demuirgos Oct 15, 2024
8db8d2b
ILVM tracing mode, skip tracing in runtime if tracer is not tracing i…
Demuirgos Oct 16, 2024
aa7aae9
added more tests
Demuirgos Oct 16, 2024
d72dbd1
Added Analysis Queue
Demuirgos Oct 17, 2024
9bbf639
removed empty lines
Demuirgos Oct 17, 2024
13d793e
minor refactor
Demuirgos Oct 17, 2024
d3bc4fc
minor cleanup
Demuirgos Oct 22, 2024
4739401
minor refactor
Demuirgos Oct 22, 2024
2841d2f
fixes to PUSH0 and SHR and SHL
Demuirgos Oct 22, 2024
e77ac73
fix SHR / SHL
Demuirgos Oct 22, 2024
a6cbb87
fix jjmp opcodes
Demuirgos Oct 24, 2024
23caab8
refactor Bitwise OPs to use Vector256 operations
Demuirgos Oct 25, 2024
5adcf53
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Oct 25, 2024
814fe99
use Vector256 in NOT opcode
Demuirgos Oct 25, 2024
a02a462
make KECCAK256 use KeccakCache
Demuirgos Oct 25, 2024
fbc1b39
add parity tracing mode
Demuirgos Oct 25, 2024
5cfc132
fix NOT opcode
Demuirgos Oct 25, 2024
2b3a80c
remove unused function
Demuirgos Oct 25, 2024
be53a03
simplify ISZERO and EQ
Demuirgos Oct 25, 2024
95ca473
fix EQ and certain operations on Word struct
Demuirgos Oct 27, 2024
d683e09
fix type mismatch in EQ, and other refactors
Demuirgos Oct 27, 2024
a898461
optimise CleanAndLoad method
Demuirgos Oct 27, 2024
f04d646
fix JITTED code for SAR
Demuirgos Oct 29, 2024
bee0270
opcode fixes, and tests upgrades
Demuirgos Oct 31, 2024
5899f78
fix MSTORE8
Demuirgos Oct 31, 2024
ecb3170
fix SWAPN
Demuirgos Oct 31, 2024
69cc361
fix LOG opcodes
Demuirgos Oct 31, 2024
6d2b76d
merge master into ilevm branch
Demuirgos Oct 31, 2024
3550369
fix Address property in Word
Demuirgos Oct 31, 2024
b237148
fix merge issue for LOG opcode
Demuirgos Oct 31, 2024
3930961
fixes for CODESIZE and BYTE and PREVRANDAO opcodes, rework for tests,…
Demuirgos Oct 31, 2024
a577b4d
Prioritize JIT over PAT when starting analysis, fix failing tests
Demuirgos Oct 31, 2024
f8dbb3d
Refactors
Demuirgos Nov 1, 2024
c3ee162
Fix/il evm opcodes [SLOAD, MCOPY, SAR] (#7703)
SiddharthV1 Nov 3, 2024
dc48774
remove unncessary loop in tests
Demuirgos Nov 3, 2024
3196fac
Merge branch 'feature/il-evm' of https://github.com/NethermindEth/net…
Demuirgos Nov 3, 2024
61b01e2
refactor + comment
Demuirgos Nov 3, 2024
5c5461a
revert SAR changes
Demuirgos Nov 3, 2024
354ac36
add fixes to SAR
Demuirgos Nov 3, 2024
afb56eb
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Nov 3, 2024
e45bd27
Fix TStore, TLoad gas (#7709)
SiddharthV1 Nov 4, 2024
5a8a7f2
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Nov 4, 2024
6beb634
Merge branch 'feature/il-evm' of https://github.com/NethermindEth/net…
Demuirgos Nov 4, 2024
772f565
fixed tests to use Prague fork
Demuirgos Nov 4, 2024
324393f
fix Instruction Metadata dictionary
Demuirgos Nov 4, 2024
f5f3cf7
fix ISZERO
Demuirgos Nov 5, 2024
62befd0
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Nov 5, 2024
6632bdc
minor changes to ISZERO to avoid triple loading
Demuirgos Nov 5, 2024
12b5ddc
fix SGT and SLT
Demuirgos Nov 7, 2024
3d21462
Added more tests
Demuirgos Nov 7, 2024
514e75e
Merge remote-tracking branch 'origin/master' into feature/il-evm
Demuirgos Nov 7, 2024
96b15ae
fixes for LOGx opcodes
Demuirgos Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Nethermind/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<PackageVersion Include="RocksDB" Version="9.4.0.50294" />
<PackageVersion Include="SCrypt" Version="2.0.0.2" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="Sigil" Version="5.0.0" />
<PackageVersion Include="Snappier" Version="1.1.6" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.24517.1" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
Expand Down
2 changes: 2 additions & 0 deletions src/Nethermind/Nethermind.Api/IBasicApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Nethermind.Core.Timers;
using Nethermind.Crypto;
using Nethermind.Db;
using Nethermind.Evm.Config;
using Nethermind.KeyStore;
using Nethermind.Logging;
using Nethermind.Serialization.Json;
Expand All @@ -33,6 +34,7 @@ public interface IBasicApi
ICryptoRandom CryptoRandom { get; }
IDbProvider? DbProvider { get; set; }
IDbFactory? DbFactory { get; set; }
IVMConfig? VMConfig { get; set; }
IEthereumEcdsa? EthereumEcdsa { get; set; }
IJsonSerializer EthereumJsonSerializer { get; set; }
IFileSystem FileSystem { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions src/Nethermind/Nethermind.Api/NethermindApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
using Nethermind.Wallet;
using Nethermind.Sockets;
using Nethermind.Trie;
using Nethermind.Evm.Config;
using Nethermind.Consensus.Processing.CensorshipDetector;
using Nethermind.Facade.Find;

Expand Down Expand Up @@ -114,6 +115,7 @@ public IBlockchainBridge CreateBlockchainBridge()
}

public IAbiEncoder AbiEncoder { get; } = Nethermind.Abi.AbiEncoder.Instance;
public IVMConfig? VMConfig { get; set; }
public IBlobTxStorage? BlobTxStorage { get; set; }
public IBlockchainProcessor? BlockchainProcessor { get; set; }
public CompositeBlockPreprocessorStep BlockPreprocessor { get; } = new();
Expand Down
5 changes: 5 additions & 0 deletions src/Nethermind/Nethermind.Core/Extensions/IntExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ namespace Nethermind.Core.Extensions;

public static class IntExtensions
{
public static bool HasFlag(this int @this, int flag)
{
return (@this & flag) == flag;
}

public static string ToHexString(this int @this)
{
return $"0x{@this:x}";
Expand Down
Loading
Loading