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

Vt/sync #48

Open
wants to merge 143 commits into
base: vt/base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
b68ef7d
add verkle tree eip in prague hardfork (#4975)
tanishqjasoria Dec 7, 2022
0d50c8d
modify account and add structure to collect verkle witness
tanishqjasoria May 5, 2023
8a8b378
add unit tests for verkle
tanishqjasoria May 5, 2023
bee4fba
add verkle tree structure
tanishqjasoria May 5, 2023
5c3ad5e
fix verkle witness
tanishqjasoria May 5, 2023
7f86b9b
add state access mechanism for verkle trees
tanishqjasoria May 5, 2023
38a07a9
update to enable verkle trees
tanishqjasoria May 5, 2023
1e0f529
Add bev-hills and kaustinen
tanishqjasoria May 8, 2023
5c93061
fix evm state
tanishqjasoria May 8, 2023
23e4ae2
update intrinsic gas calc and test
tanishqjasoria May 8, 2023
5445fcb
refactor the database layout and update verkle tree
tanishqjasoria May 9, 2023
df74d47
add verkle proof creation and verification
tanishqjasoria May 10, 2023
d98dd6c
add sync constructs for verkle sync
tanishqjasoria May 15, 2023
6f1dc54
add verkle stateless tree creation from proofs
tanishqjasoria May 22, 2023
8ac303d
updates
tanishqjasoria May 24, 2023
8172a06
add func to generate range proof
tanishqjasoria May 24, 2023
90b2701
add range proofs
tanishqjasoria May 25, 2023
aecbc5f
add tests
tanishqjasoria May 25, 2023
92fc1ab
remove unused functions
tanishqjasoria May 25, 2023
a6e12f0
temp fix
tanishqjasoria May 25, 2023
1f3dcfc
refactor
tanishqjasoria May 25, 2023
4aa9ab8
refactor
tanishqjasoria May 25, 2023
cbef278
insert into tree when true
tanishqjasoria May 25, 2023
befc89c
fix prover and tests
tanishqjasoria May 25, 2023
ee1a13f
fix stateless tree creation
tanishqjasoria May 29, 2023
bf26c8f
Refactor
tanishqjasoria May 29, 2023
f51e001
fix sync provider
tanishqjasoria May 29, 2023
e5f68c5
refactor and add tests for sync
tanishqjasoria May 29, 2023
283ed72
refactor
tanishqjasoria May 29, 2023
6d69282
use structs for pedersen hash
tanishqjasoria May 30, 2023
3fc3c3a
refactor sync
tanishqjasoria May 30, 2023
478d737
a better way to represent the subtree batch
tanishqjasoria May 30, 2023
f24ef89
restructure database
tanishqjasoria May 30, 2023
c5b41f3
add tests and more constructs to enable verkle sync
tanishqjasoria May 31, 2023
e3398ce
fix IsFullySynced
tanishqjasoria Jun 1, 2023
0c30b86
more sync structure related changes
tanishqjasoria Jun 1, 2023
49b4415
Add verkle sync to multi mode selector
tanishqjasoria Jun 1, 2023
02d5737
Remove unsed
tanishqjasoria Jun 5, 2023
6cf3cd2
add stats collector for verkle
tanishqjasoria Jun 6, 2023
8261fc6
update vt to use sorted dicts in mem difs
tanishqjasoria Jun 6, 2023
1fe1973
add range iterator generator
tanishqjasoria Jun 7, 2023
274c18b
add GetSubTreeRange
tanishqjasoria Jun 7, 2023
3a1640f
update getRange verkle snap
tanishqjasoria Jun 7, 2023
521653d
use list here
tanishqjasoria Jun 7, 2023
16a1803
Add logs
tanishqjasoria Jun 7, 2023
4085839
Add more logs
tanishqjasoria Jun 7, 2023
8ca5542
add range enumerators for dbs
tanishqjasoria Jun 8, 2023
54bc1e5
update memdb to get sorted structures
tanishqjasoria Jun 8, 2023
f32066f
update names
tanishqjasoria Jun 8, 2023
a9f661c
optimize iterator creation
tanishqjasoria Jun 9, 2023
2edaea2
add priotirty
tanishqjasoria Jun 10, 2023
c6c389e
update server
tanishqjasoria Jun 12, 2023
2d446a0
update persistant db iterator
tanishqjasoria Jun 13, 2023
4bc0885
fix iterator
tanishqjasoria Jun 13, 2023
fd4e6f1
update tests
tanishqjasoria Jun 13, 2023
c14c61a
Add iterator to get sized response
tanishqjasoria Jun 13, 2023
2662c80
update test
tanishqjasoria Jun 14, 2023
b0300eb
updatE
tanishqjasoria Jun 14, 2023
87ad03a
update
tanishqjasoria Jun 14, 2023
1ac68cb
update
tanishqjasoria Jun 14, 2023
9d7fff6
update spec struct
tanishqjasoria Jun 14, 2023
d516223
use Stem instead
tanishqjasoria Jun 14, 2023
3301522
create tree from block witness
tanishqjasoria Jun 14, 2023
decce52
generate execution witness
tanishqjasoria Jun 14, 2023
7d1ca00
update structures
tanishqjasoria Jun 14, 2023
6637b67
heal the tree from execution witness
tanishqjasoria Jun 14, 2023
c57b799
add test to sync while new blocks - add healing
tanishqjasoria Jun 15, 2023
b72f515
return the last subtree too
tanishqjasoria Jun 19, 2023
b08db39
add tests for healing tree using execution witness
tanishqjasoria Jun 19, 2023
9f438b2
refac tree
tanishqjasoria Jun 19, 2023
caa30b8
refactor state store
tanishqjasoria Jun 19, 2023
1df9fb2
refactorf
tanishqjasoria Jun 19, 2023
3d2d976
remove the handling for same state root
tanishqjasoria Jun 20, 2023
aca1618
handle root hash properly
tanishqjasoria Jun 20, 2023
0ad69f6
update traces to trace verkle witness
tanishqjasoria Jun 20, 2023
ca6c5f6
update prover and tree:
tanishqjasoria Jun 21, 2023
c5855e7
refactor StateStore
tanishqjasoria Jun 21, 2023
3127a19
refactor
tanishqjasoria Jun 21, 2023
7cf6c70
add witness to trackers
tanishqjasoria Jun 21, 2023
ae86009
Aggregated witness
tanishqjasoria Jun 21, 2023
5078a24
Add tests
tanishqjasoria Jun 21, 2023
352c818
fix verkle witness
tanishqjasoria Jun 22, 2023
9352f50
Add parent for processing
tanishqjasoria Jun 26, 2023
8ac87b0
use parent header
tanishqjasoria Jun 26, 2023
f6a052b
log verkle witness
tanishqjasoria Jun 26, 2023
65e0d48
check proof
tanishqjasoria Jun 26, 2023
d66adf3
fix proof and execution
tanishqjasoria Jun 26, 2023
e00e819
update
tanishqjasoria Jun 26, 2023
666168e
add logs and dont erase cache
tanishqjasoria Jun 27, 2023
164ebb8
fix stateless tree
tanishqjasoria Jun 27, 2023
bca43fa
Add tests
tanishqjasoria Jun 27, 2023
a639442
update logs
tanishqjasoria Jun 27, 2023
1c9b622
add more tests
tanishqjasoria Jun 27, 2023
9223707
modify access modifier
tanishqjasoria Jun 27, 2023
6932460
add statelss block processor
tanishqjasoria Jun 27, 2023
0e99f8f
fix serializer and upate traversel
tanishqjasoria Jun 28, 2023
cc79130
update tests
tanishqjasoria Jun 28, 2023
5a725c8
temp logs
tanishqjasoria Jun 28, 2023
4654e43
can execute vm using chunks also
tanishqjasoria Jul 3, 2023
5347571
update execution witness
tanishqjasoria Jul 3, 2023
0bdc7de
Add stem convertor
tanishqjasoria Jul 3, 2023
7c97027
fix get block
tanishqjasoria Jul 3, 2023
55fff54
update exec witness and json
tanishqjasoria Jul 3, 2023
114c368
update json serialization for execWitness
tanishqjasoria Jul 3, 2023
42b5ec4
remove assert and stateless tx processor
tanishqjasoria Jul 4, 2023
17f030c
move exec witness to block body
tanishqjasoria Jul 4, 2023
e5741eb
add serilizer for execution witness
tanishqjasoria Jul 4, 2023
0554cdf
use bigendian
tanishqjasoria Jul 6, 2023
2b5a14d
fix rlp
tanishqjasoria Jul 6, 2023
c57d8da
add log
tanishqjasoria Jul 6, 2023
d5881b1
Add one test
tanishqjasoria Jul 6, 2023
bbe6b84
Add more tests
tanishqjasoria Jul 6, 2023
06ec3d9
add staless flag
tanishqjasoria Jul 6, 2023
80362e0
staless
tanishqjasoria Jul 6, 2023
420c415
add comments
tanishqjasoria Jul 6, 2023
37f1def
comments
tanishqjasoria Jul 6, 2023
59c7227
log witness
tanishqjasoria Jul 7, 2023
91cad08
remove exec witness
tanishqjasoria Jul 8, 2023
0640e76
remove redundant logs
tanishqjasoria Jul 8, 2023
823aa05
Add gas benef witness
tanishqjasoria Jul 13, 2023
6fbdd04
refactor stateless processing
tanishqjasoria Jul 10, 2023
958bc51
update message
tanishqjasoria Jul 13, 2023
e0d8a36
add stateless processing:
tanishqjasoria Jul 13, 2023
dce42d1
remove logs
tanishqjasoria Jul 17, 2023
92f7770
Add temp stateless verifier to processing
tanishqjasoria Jul 18, 2023
3e28d34
Small
tanishqjasoria Jul 18, 2023
a3e42d1
update proof
tanishqjasoria Jul 18, 2023
6168553
Refactor state store
tanishqjasoria Jul 25, 2023
d4546fd
Refactor flush
tanishqjasoria Jul 25, 2023
4f41c85
fix reverse diff
tanishqjasoria Jul 26, 2023
115a5fe
annouunce reorg boundries
tanishqjasoria Jul 26, 2023
e91c368
remove stateless
tanishqjasoria Jul 26, 2023
36cd976
reorg boundry
tanishqjasoria Jul 26, 2023
bdcfc13
fix restart
tanishqjasoria Jul 26, 2023
402f3a6
fix state root
tanishqjasoria Jul 26, 2023
9e93c43
commitment to bytes
tanishqjasoria Jul 26, 2023
89fb913
Add bytes to internal nodes
tanishqjasoria Jul 26, 2023
ec24e78
move logs from info to debug
tanishqjasoria Jul 26, 2023
f1d77c6
remove log
tanishqjasoria Jul 26, 2023
1677765
Refactor
tanishqjasoria Jul 26, 2023
65f3cd9
Rename to verkle commitment
tanishqjasoria Jul 26, 2023
66c61df
add logs
tanishqjasoria Jul 27, 2023
1b6da11
refactor and add other things for stateless exec
tanishqjasoria Jul 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
886 changes: 886 additions & 0 deletions src/Nethermind/Chains/beverly-hills.json

Large diffs are not rendered by default.

103 changes: 103 additions & 0 deletions src/Nethermind/Chains/kaustinen.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Nethermind/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<PackageVersion Include="Nethermind.DotNetty.Transport" Version="1.0.0" />
<PackageVersion Include="Nethermind.Gmp" Version="1.0.1" />
<PackageVersion Include="Nethermind.Numerics.Int256" Version="1.1.0" />
<PackageVersion Include="Nethermind.Verkle" Version="0.1.3-alpha" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
<PackageVersion Include="Nito.Collections.Deque" Version="1.1.1" />
<PackageVersion Include="NLog" Version="5.1.2" />
Expand Down Expand Up @@ -80,4 +81,4 @@
<PackageVersion Include="Websocket.Client" Version="4.5.2" />
<PackageVersion Include="YamlDotNet" Version="13.0.1" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public UserOperationTxTracer(
public byte[] Output { get; private set; }

public bool IsTracingReceipt => true;
public bool IsTracingVerkleWitness => false;
public bool IsTracingActions => true;
public bool IsTracingOpLevelStorage => true;
public bool IsTracingMemory => false;
Expand Down Expand Up @@ -185,6 +186,11 @@ public void StartOperation(int depth, long gas, Instruction opcode, int pc, bool
}
}

public void SetVerkleWitnessKeys(IReadOnlyList<byte[]> verkleWitnessKeys)
{
throw new NotImplementedException();
}

public void ReportOperationError(EvmExceptionType error)
{
}
Expand Down
3 changes: 3 additions & 0 deletions src/Nethermind/Nethermind.Api/IApiWithBlockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using Nethermind.State;
using Nethermind.Trie.Pruning;
using Nethermind.TxPool;
using Nethermind.Verkle.Tree;

namespace Nethermind.Api
{
Expand All @@ -43,6 +44,8 @@ public interface IApiWithBlockchain : IApiWithStores, IBlockchainBridgeFactory
IUnclesValidator? UnclesValidator { get; set; }
IHeaderValidator? HeaderValidator { get; set; }
IManualBlockProductionTrigger ManualBlockProductionTrigger { get; }
VerkleStateStore? VerkleTrieStore { get; set; }
ReadOnlyVerkleStateStore? ReadOnlyVerkleTrieStore { get; set; }
IReadOnlyTrieStore? ReadOnlyTrieStore { get; set; }
IRewardCalculatorSource? RewardCalculatorSource { get; set; }
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Nethermind/Nethermind.Api/IApiWithNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Nethermind.Sockets;
using Nethermind.Synchronization.Blocks;
using Nethermind.Synchronization.SnapSync;
using Nethermind.Synchronization.VerkleSync;

namespace Nethermind.Api
{
Expand Down Expand Up @@ -52,5 +53,6 @@ public interface IApiWithNetwork : IApiWithBlockchain
IWebSocketsManager WebSocketsManager { get; set; }
ISubscriptionFactory? SubscriptionFactory { get; set; }
ISnapProvider? SnapProvider { get; set; }
IVerkleSyncProvider? VerkleProvider { get; set; }
}
}
23 changes: 16 additions & 7 deletions src/Nethermind/Nethermind.Api/NethermindApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
using Nethermind.Sockets;
using Nethermind.Synchronization.SnapSync;
using Nethermind.Synchronization.Blocks;
using Nethermind.Synchronization.VerkleSync;
using Nethermind.Verkle;
using Nethermind.Verkle.Tree;

namespace Nethermind.Api
{
Expand All @@ -77,13 +80,15 @@ public IBlockchainBridge CreateBlockchainBridge()
ReadOnlyBlockTree readOnlyTree = BlockTree!.AsReadOnly();
LazyInitializer.EnsureInitialized(ref _readOnlyDbProvider, () => new ReadOnlyDbProvider(DbProvider, false));

// TODO: reuse the same trie cache here
ReadOnlyTxProcessingEnv readOnlyTxProcessingEnv = new(
_readOnlyDbProvider,
ReadOnlyTrieStore,
readOnlyTree,
SpecProvider,
LogManager);
ReadOnlyTxProcessingEnv readOnlyTxProcessingEnv = SpecProvider!.GenesisSpec.IsVerkleTreeEipEnabled switch
{
true =>
// TODO: reuse the same trie cache here
new ReadOnlyTxProcessingEnv(_readOnlyDbProvider, ReadOnlyVerkleTrieStore, readOnlyTree, SpecProvider, LogManager),
false =>
// TODO: reuse the same trie cache here
new ReadOnlyTxProcessingEnv(_readOnlyDbProvider, ReadOnlyTrieStore, readOnlyTree, SpecProvider, LogManager)
};

IMiningConfig miningConfig = ConfigProvider.GetConfig<IMiningConfig>();
IBlocksConfig blocksConfig = ConfigProvider.GetConfig<IBlocksConfig>();
Expand Down Expand Up @@ -134,6 +139,9 @@ public IBlockchainBridge CreateBlockchainBridge()
public IManualBlockProductionTrigger ManualBlockProductionTrigger { get; set; } =
new BuildBlocksWhenRequested();

public VerkleStateStore? VerkleTrieStore { get; set; }
public ReadOnlyVerkleStateStore? ReadOnlyVerkleTrieStore { get; set; }

public IIPResolver? IpResolver { get; set; }
public IJsonSerializer EthereumJsonSerializer { get; set; }
public IKeyStore? KeyStore { get; set; }
Expand Down Expand Up @@ -231,6 +239,7 @@ public ISealEngine SealEngine
public IList<IPublisher> Publishers { get; } = new List<IPublisher>(); // this should be called publishers
public CompositePruningTrigger PruningTrigger { get; } = new();
public ISnapProvider? SnapProvider { get; set; }
public IVerkleSyncProvider? VerkleProvider { get; set; }
public IProcessExitSource? ProcessExit { get; set; }
}
}
Loading