Skip to content

Commit

Permalink
Update architecture.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaeltarimo authored Jan 15, 2024
1 parent a604745 commit 4f2ee47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions evm-utils/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ So our design was to implement storage, for big state, with versioning support.
This rpc calls need to get state from past, so support multiple version of storage is also required.

### Abstract view of Trie db
As state provider, we adopt https://github.com/ChuiNetwork/triedb - this is modified merkle-patricia tree from sputnikvm https://github.com/ETCDEVTeam/etcommon-rs/tree/master/trie with small code cleanups, and refactoring to make it work only with rocksdb (persistent storage). See https://eth.wiki/en/fundamentals/patricia-tree as reference for implementation, and https://medium.com/@chiqing/merkle-patricia-trie-explained-ae3ac6a7e123 as explanation how it works.
As state provider, we adopt https://github.com/velas/triedb - this is modified merkle-patricia tree from sputnikvm https://github.com/ETCDEVTeam/etcommon-rs/tree/master/trie with small code cleanups, and refactoring to make it work only with rocksdb (persistent storage). See https://eth.wiki/en/fundamentals/patricia-tree as reference for implementation, and https://medium.com/@chiqing/merkle-patricia-trie-explained-ae3ac6a7e123 as explanation how it works.

In shorts, we work with this as with k-v database:
where k - is an evm account address (20 bytes long),
Expand Down Expand Up @@ -193,4 +193,4 @@ when any transaction make call to specific address `ETH_TO_CUI_ADDR` program int
When it is called, it expect `recipient` address as argument, also this precompile is done as payable, so it is also expect internal `value` argument, before call this value is substracted from caller account. And `ETH_TO_CUI_CODE` is transfer it from EvmState account to account that it tries to find by `recipient` address.

Problems that we discover before:
- Both our swaps works invalid with revert. `SwapNativeToEther` with revert in solana can keep money on evm, and reverts in evm didn't trigger revert in solana. To fix this, now revert in evm trigger revert in solana, and on any revert, state changes are ignored for whole transaction execution.
- Both our swaps works invalid with revert. `SwapNativeToEther` with revert in solana can keep money on evm, and reverts in evm didn't trigger revert in solana. To fix this, now revert in evm trigger revert in solana, and on any revert, state changes are ignored for whole transaction execution.

0 comments on commit 4f2ee47

Please sign in to comment.