Skip to content

Commit

Permalink
chore: nits and formating
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita committed Jul 9, 2023
1 parent a40108f commit f172231
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 47 deletions.
4 changes: 2 additions & 2 deletions content/blog/2d_transformations/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
+++
title = "2D UI beginner guide. Learn to rotate/translate/scale"
description = "2D UI beginner guide. Learn to rotate/translate/scale"
date = 2022-04-20T09:19:42+00:00
updated = 2020-04-20T09:19:42+00:00
date = 2019-12-20T09:19:42+00:00
updated = 2019-12-20T09:19:42+00:00
draft = false
template = "blog/page.html"

Expand Down
15 changes: 6 additions & 9 deletions content/blog/parallel_evm_claim/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
+++
title = "Parallel EVM claim"
description = "How to verify claim of parallel execution"
date = 2023-07-09T22:00:00+00:00
updated = 2023-07-09T22:00:00+00:00
date = 2023-07-09T22:20:00+00:00
updated = 2023-07-09T22:20:00+00:00
draft = false
template = "blog/page.html"

Expand All @@ -28,10 +28,10 @@ All examples start from the point that we received a DAG of transaction and the

We have two transactions that read/write to the **same** state (there is only one state that all of them share) and the update to that state is atomic. The example here is very simple but it allows us to set up some groundwork and initial ideas of what is checked.

[Mermaid graph](https://mermaid.live/edit#pako:eNpdTrsOwjAQ-5XII2oGOmZgYmViJAyn5gqRmgSlFwSq-u8cMCDhyfJD9oKhBIbDLCS8j3SplOy999koTpuzsXZn5LH9F3p0SFwTxaDt5W17yJUTezilgUdqk3j4vGqUmpTjMw9wUht3aLfw24MbaZpV5RCl1MP30efY-gKkKDNp)

![](./example_2tx.png)

[Graph](https://mermaid.live/edit#pako:eNpdTrsOwjAQ-5XII2oGOmZgYmViJAyn5gqRmgSlFwSq-u8cMCDhyfJD9oKhBIbDLCS8j3SplOy999koTpuzsXZn5LH9F3p0SFwTxaDt5W17yJUTezilgUdqk3j4vGqUmpTjMw9wUht3aLfw24MbaZpV5RCl1MP30efY-gKkKDNp)


For the sake of explaining we are simplifying state and seeing it as a list of accounts, these "accounts" can be a balance/nonce/code hash(code)/storage slot, it is just easier to reason and think about in simpler form.

Expand All @@ -50,7 +50,6 @@ The second example is having a third transaction that depends on the first one.

![](./example_chain.png)


[Graph](https://mermaid.live/edit#pako:eNpdjjEOwjAMRa8SeUTNQMuUgYmViZEwWI0LkZoEpU4Fqnp3DC1CwtPX-7b1JmiTIzAwMDIdPF4zBj3WNiqZ8-aitN4rfmwXIGEFzRc0K9j9n9RQQaAc0Dv5P71rC3yjQBaMREcdlp4t2DjLKhZOp2dswXAuVEG5u58RmA77QSg5zykfF-eP-vwC_v88KA)

This is the first example of dependent transactions and`tx3` can access only accounts that are in the original state or touched by `tx1`, if both `tx3` and `tx2` access the same account this would make the parallelism claim invalid.
Expand All @@ -63,7 +62,6 @@ Modelling dependency can be tricky but in parallel execution, there are only two

![](./example_fork_join.png)


[Graph](https://mermaid.live/edit#pako:eNpdj7EOwjAMRH-l8oiagRSWDEysTIwNg9W4EKlJUOogUNV_J9BWFXg6vTtZdwM0wRAo6BmZjhavEZ14SO2LfPXmUghxKPi5nUAWM6gWUM1g95_YL0D-gvWphBIcRYfW5AbDx9bAN3KkQWVpqMXUsQbtxxzFxOH88g0ojolKSHezdgbVYtdnSsZyiKdp1Xfc-AaEXkTp)

There is one fork here, and can be seen in the example of `tx1` that forks its state to chains of `tx5` and `tx3`. This means that there is a dependency between `tx5` and `tx1`, `tx3` and `tx1` but there are no dependencies on `tx3` and `tx5` and they can be run in parallel.
Expand All @@ -75,14 +73,13 @@ The mechanism of marking the state works the same as in the first example. `tx5`

This is a good example that tests our initial mechanism of marking of accessed state.

[Graph](https://mermaid.live/edit#pako:eNpd0D0PgjAQBuC_Qm40MMiHJB2cXJ0crcOFHkpCKSlXoyH8d6uUmPSmy3PvcHczNEYRCJgYmU4d3i3q7JnLIfF13d2SLDsm_Nqv4JsAxQZFgDJOVBvkMZQBDhtUAeo4Ucd75JCCJquxU37p-TuWwA_SJEH4VlGLrmcJclh8FB2by3toQLB1lIIb1f9MEC32k1dSHRt7Xh_x-8fyAQIhUhg)

![](./example_diamont.png)

[Graph](https://mermaid.live/edit#pako:eNpd0D0PgjAQBuC_Qm40MMiHJB2cXJ0crcOFHkpCKSlXoyH8d6uUmPSmy3PvcHczNEYRCJgYmU4d3i3q7JnLIfF13d2SLDsm_Nqv4JsAxQZFgDJOVBvkMZQBDhtUAeo4Ucd75JCCJquxU37p-TuWwA_SJEH4VlGLrmcJclh8FB2by3toQLB1lIIb1f9MEC32k1dSHRt7Xh_x-8fyAQIhUhg)

All previous statements should be valid here.

For example `tx7` can only touch original state or `tx1`,`tx2`,`tx3`,`tx4`,`tx5` but not `tx6`, and same with `tx6` it can't touch state of `tx7`
For example `tx7` can only touch original state or `tx1`, `tx2`, `tx3`, `tx4`, `tx5` but not `tx6`, and same with `tx6` it can't touch state of `tx7`

## How to check marks

Expand Down
46 changes: 23 additions & 23 deletions public/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<link href="https://rakita.github.io/blog/atom.xml" rel="self" type="application/atom+xml"/>
<link href="https://rakita.github.io/blog/"/>
<generator uri="https://www.getzola.org/">Zola</generator>
<updated>2023-07-09T22:00:00+00:00</updated>
<updated>2023-07-09T22:20:00+00:00</updated>
<id>https://rakita.github.io/blog/atom.xml</id>
<entry xml:lang="en">
<title>Parallel EVM claim</title>
<published>2023-07-09T22:00:00+00:00</published>
<updated>2023-07-09T22:00:00+00:00</updated>
<published>2023-07-09T22:20:00+00:00</published>
<updated>2023-07-09T22:20:00+00:00</updated>
<author>
<name>Unknown</name>
</author>
Expand All @@ -25,8 +25,8 @@
&lt;p&gt;All examples start from the point that we received a DAG of transaction and the builder claims that transaction can be done in parallel. We want to execute those transactions in parallel and be sure that the claim is correct and that there are no inconsistencies (data races) that can happen.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;example-1-simple-two-parallel-transactions&quot;&gt;Example 1: simple two parallel transactions&lt;&#x2F;h3&gt;
&lt;p&gt;We have two transactions that read&#x2F;write to the &lt;strong&gt;same&lt;&#x2F;strong&gt; state (there is only one state that all of them share) and the update to that state is atomic. The example here is very simple but it allows us to set up some groundwork and initial ideas of what is checked.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;mermaid.live&#x2F;edit#pako:eNpdTrsOwjAQ-5XII2oGOmZgYmViJAyn5gqRmgSlFwSq-u8cMCDhyfJD9oKhBIbDLCS8j3SplOy999koTpuzsXZn5LH9F3p0SFwTxaDt5W17yJUTezilgUdqk3j4vGqUmpTjMw9wUht3aLfw24MbaZpV5RCl1MP30efY-gKkKDNp&quot;&gt;Mermaid graph&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;rakita.github.io&#x2F;blog&#x2F;blog&#x2F;parallel-evm-claim&#x2F;.&#x2F;example_2tx.png&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;mermaid.live&#x2F;edit#pako:eNpdTrsOwjAQ-5XII2oGOmZgYmViJAyn5gqRmgSlFwSq-u8cMCDhyfJD9oKhBIbDLCS8j3SplOy999koTpuzsXZn5LH9F3p0SFwTxaDt5W17yJUTezilgUdqk3j4vGqUmpTjMw9wUht3aLfw24MbaZpV5RCl1MP30efY-gKkKDNp&quot;&gt;Graph&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;For the sake of explaining we are simplifying state and seeing it as a list of accounts, these &amp;quot;accounts&amp;quot; can be a balance&#x2F;nonce&#x2F;code hash(code)&#x2F;storage slot, it is just easier to reason and think about in simpler form.&lt;&#x2F;p&gt;
&lt;p&gt;Additionally, we should consider both reads and writes of accounts as the same thing. This can be explored as a follow-up but for the first iteration, it is easier to omit this distinction. So this means that the transaction touched state consists of both reads and writes that this transaction did. And with this, having an account read from two different parallel transactions is considered invalid.&lt;&#x2F;p&gt;
&lt;p&gt;Now, the idea here is that on every access of an account (read or write) to mark that account in the state as accessed by that transaction. This means that if account &lt;code&gt;0x01&lt;&#x2F;code&gt; is accessed by &lt;code&gt;tx1&lt;&#x2F;code&gt; it will be marked as such and if &lt;code&gt;tx2&lt;&#x2F;code&gt; tries to access account &lt;code&gt;0x1&lt;&#x2F;code&gt; we will notice that account is already marked and see that there is inconsistency and data race in place.&lt;&#x2F;p&gt;
Expand All @@ -46,10 +46,10 @@
&lt;p&gt;The mechanism of marking the state works the same as in the first example. &lt;code&gt;tx5&lt;&#x2F;code&gt; can now access the account of the original or &lt;code&gt;tx1&lt;&#x2F;code&gt; or &lt;code&gt;tx2&lt;&#x2F;code&gt; accounts if it accessed the state of &lt;code&gt;tx3&lt;&#x2F;code&gt; or &lt;code&gt;tx3&lt;&#x2F;code&gt; this would make parallel claim invalid.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;example-4-diamond-pattern&quot;&gt;Example 4: Diamond pattern&lt;&#x2F;h2&gt;
&lt;p&gt;This is a good example that tests our initial mechanism of marking of accessed state.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;mermaid.live&#x2F;edit#pako:eNpd0D0PgjAQBuC_Qm40MMiHJB2cXJ0crcOFHkpCKSlXoyH8d6uUmPSmy3PvcHczNEYRCJgYmU4d3i3q7JnLIfF13d2SLDsm_Nqv4JsAxQZFgDJOVBvkMZQBDhtUAeo4Ucd75JCCJquxU37p-TuWwA_SJEH4VlGLrmcJclh8FB2by3toQLB1lIIb1f9MEC32k1dSHRt7Xh_x-8fyAQIhUhg&quot;&gt;Graph&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;rakita.github.io&#x2F;blog&#x2F;blog&#x2F;parallel-evm-claim&#x2F;.&#x2F;example_diamont.png&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;mermaid.live&#x2F;edit#pako:eNpd0D0PgjAQBuC_Qm40MMiHJB2cXJ0crcOFHkpCKSlXoyH8d6uUmPSmy3PvcHczNEYRCJgYmU4d3i3q7JnLIfF13d2SLDsm_Nqv4JsAxQZFgDJOVBvkMZQBDhtUAeo4Ucd75JCCJquxU37p-TuWwA_SJEH4VlGLrmcJclh8FB2by3toQLB1lIIb1f9MEC32k1dSHRt7Xh_x-8fyAQIhUhg&quot;&gt;Graph&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;All previous statements should be valid here.&lt;&#x2F;p&gt;
&lt;p&gt;For example &lt;code&gt;tx7&lt;&#x2F;code&gt; can only touch original state or &lt;code&gt;tx1&lt;&#x2F;code&gt;,&lt;code&gt;tx2&lt;&#x2F;code&gt;,&lt;code&gt;tx3&lt;&#x2F;code&gt;,&lt;code&gt;tx4&lt;&#x2F;code&gt;,&lt;code&gt;tx5&lt;&#x2F;code&gt; but not &lt;code&gt;tx6&lt;&#x2F;code&gt;, and same with &lt;code&gt;tx6&lt;&#x2F;code&gt; it can&#x27;t touch state of &lt;code&gt;tx7&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;For example &lt;code&gt;tx7&lt;&#x2F;code&gt; can only touch original state or &lt;code&gt;tx1&lt;&#x2F;code&gt;, &lt;code&gt;tx2&lt;&#x2F;code&gt;, &lt;code&gt;tx3&lt;&#x2F;code&gt;, &lt;code&gt;tx4&lt;&#x2F;code&gt;, &lt;code&gt;tx5&lt;&#x2F;code&gt; but not &lt;code&gt;tx6&lt;&#x2F;code&gt;, and same with &lt;code&gt;tx6&lt;&#x2F;code&gt; it can&#x27;t touch state of &lt;code&gt;tx7&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-to-check-marks&quot;&gt;How to check marks&lt;&#x2F;h2&gt;
&lt;p&gt;Every transaction could have a list of previous dependent transactions, and when checking the mark inside the database we compare it if it is found inside that list.&lt;&#x2F;p&gt;
&lt;p&gt;This list can be sorted so finding particular values can be done by binary search. The list size depends on the number of dependent transactions.&lt;&#x2F;p&gt;
Expand Down Expand Up @@ -86,13 +86,28 @@
&lt;p&gt;One of the pending things that need to be defined when parallel transactions are considered for inclusion. This probably can be done by some calculation on the DAG and its weight (gas).&lt;&#x2F;p&gt;
&lt;p&gt;Separation of current gas accounting on CPU gas and disk io gas firstly specified in &lt;a href=&quot;https:&#x2F;&#x2F;ethresear.ch&#x2F;t&#x2F;multidimensional-eip-1559&#x2F;11651&quot;&gt;multidimentional EIP1559&lt;&#x2F;a&gt; is probably desirable, but not required. Gas calculation is always a sensitive topic as it can be abused if not done correctly.&lt;&#x2F;p&gt;
&lt;p&gt;And as CPU cores are limited, we can have limitations on transaction DAG format.&lt;&#x2F;p&gt;
</content>

</entry>
<entry xml:lang="en">
<title>draganrakita</title>
<published>2021-04-01T08:50:45+00:00</published>
<updated>2021-04-01T08:50:45+00:00</updated>
<author>
<name>Unknown</name>
</author>
<link rel="alternate" href="https://rakita.github.io/blog/authors/draganrakita/" type="text/html"/>
<id>https://rakita.github.io/blog/authors/draganrakita/</id>

<content type="html">&lt;p&gt;Creator of &lt;strong&gt;Blog&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rakita&quot;&gt;@aaranxu&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>

</entry>
<entry xml:lang="en">
<title>2D UI beginner guide. Learn to rotate&#x2F;translate&#x2F;scale</title>
<published>2022-04-20T09:19:42+00:00</published>
<updated>2020-04-20T09:19:42+00:00</updated>
<published>2019-12-20T09:19:42+00:00</published>
<updated>2019-12-20T09:19:42+00:00</updated>
<author>
<name>Unknown</name>
</author>
Expand Down Expand Up @@ -166,21 +181,6 @@
&lt;&#x2F;span&gt;&lt;span&gt; scale.x x=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;sign&lt;&#x2F;span&gt;&lt;span&gt;(x)*&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;abs&lt;&#x2F;span&gt;&lt;span&gt;(y)
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>

</entry>
<entry xml:lang="en">
<title>draganrakita</title>
<published>2021-04-01T08:50:45+00:00</published>
<updated>2021-04-01T08:50:45+00:00</updated>
<author>
<name>Unknown</name>
</author>
<link rel="alternate" href="https://rakita.github.io/blog/authors/draganrakita/" type="text/html"/>
<id>https://rakita.github.io/blog/authors/draganrakita/</id>

<content type="html">&lt;p&gt;Creator of &lt;strong&gt;Blog&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rakita&quot;&gt;@aaranxu&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>

</entry>
Expand Down
2 changes: 1 addition & 1 deletion public/authors/draganrakita/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h2 class="h3"><a class="stretched-link text-body" href="https:&#x2F;&#x2F;rakit
<h2 class="h3"><a class="stretched-link text-body" href="https:&#x2F;&#x2F;rakita.github.io&#x2F;blog&#x2F;blog&#x2F;2d-transformations&#x2F;">2D UI beginner guide. Learn to rotate&#x2F;translate&#x2F;scale</a></h2>
<p>Post about 2d transformations that i did in my previous work life.</p>

<p><small>Posted April 20, 2022 by <a class="stretched-link position-relative" href="https://rakita.github.io/blog/authors/draganrakita/">draganrakita</a>&nbsp;&hyphen;&nbsp;<strong>9&nbsp;min read</strong></small><p>
<p><small>Posted December 20, 2019 by <a class="stretched-link position-relative" href="https://rakita.github.io/blog/authors/draganrakita/">draganrakita</a>&nbsp;&hyphen;&nbsp;<strong>9&nbsp;min read</strong></small><p>

</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions public/blog/2d-transformations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
},
"headline": "2D UI beginner guide. Learn to rotate&#x2F;translate&#x2F;scale",
"image": ,
"datePublished": "2022-04-20T09:19:42+00:00",
"dateModified": "2020-04-20T09:19:42+00:00",
"datePublished": "2019-12-20T09:19:42+00:00",
"dateModified": "2019-12-20T09:19:42+00:00",
"author": {
"@type": "Organization",
"name": "2D UI beginner guide. Learn to rotate&#x2F;translate&#x2F;scale"
Expand Down Expand Up @@ -235,7 +235,7 @@
<div class="blog-header">
<h1>2D UI beginner guide. Learn to rotate&#x2F;translate&#x2F;scale</h1>

<p><small>Posted April 20, 2022 by <a class="stretched-link position-relative" href="https://rakita.github.io/blog/authors/draganrakita/">draganrakita</a>&nbsp;&hyphen;&nbsp;<strong>9&nbsp;min read</strong></small><p>
<p><small>Posted December 20, 2019 by <a class="stretched-link position-relative" href="https://rakita.github.io/blog/authors/draganrakita/">draganrakita</a>&nbsp;&hyphen;&nbsp;<strong>9&nbsp;min read</strong></small><p>

</div>
<p class="lead">Post about 2d transformations that i did in my previous work life.</p>
Expand Down
2 changes: 1 addition & 1 deletion public/blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ <h2 class="h3"><a class="stretched-link text-body" href="https:&#x2F;&#x2F;rakit

<p class="lead">Post about 2d transformations that i did in my previous work life.</p>

<p><small>Posted April 20, 2022 by <a class="stretched-link position-relative" href="https://rakita.github.io/blog/authors/draganrakita/">draganrakita</a>&nbsp;&hyphen;&nbsp;<strong>9&nbsp;min read</strong></small><p>
<p><small>Posted December 20, 2019 by <a class="stretched-link position-relative" href="https://rakita.github.io/blog/authors/draganrakita/">draganrakita</a>&nbsp;&hyphen;&nbsp;<strong>9&nbsp;min read</strong></small><p>

</div>
</div>
Expand Down
Loading

0 comments on commit f172231

Please sign in to comment.