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

Equation: 120, when w=JUMPI, outcome of JUMPI depends on µs[1] too, so the exception Z and its coding #151

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,34 @@ before_install:
- sudo apt-get -qq update
- sudo apt-get install texlive texlive-latex3
script:
<<<<<<< HEAD
- ./build.sh
deploy:
provider: script
script: ./travis_deploy.sh
skip_cleanup: true
on:
branch: master
=======
- pdflatex -interaction=errorstopmode -halt-on-error Paper.tex
- bibtex Paper
- pdflatex -interaction=errorstopmode -halt-on-error Paper.tex
- pdflatex -interaction=errorstopmode -halt-on-error Paper.tex
- pdflatex -interaction=errorstopmode -halt-on-error Paper.tex
deploy:
provider: script
script: travis_deploy.sh
skip_cleanup: true
on:
branch: deploytest
>>>>>>> Deploy pdf from travis.
env:
global:
- ENCRYPTION_LABEL="19a81de38b62"
- COMMIT_AUTHOR_EMAIL="[email protected]"
- COMMIT_AUTHOR="Travis CI"
<<<<<<< HEAD
- PUSH_REPO="[email protected]:ethereum/yellowpaper.git"
=======
- PUSH_REPO="[email protected]:ethereum/yellowpaper.git"
>>>>>>> Deploy pdf from travis.
42 changes: 32 additions & 10 deletions Paper.tex
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,11 @@ \subsubsection{Block Header Validity}
\begin{equation}
D(H) \equiv \begin{dcases}
\mindifficulty & \text{if} \quad H_i = 0\\
<<<<<<< HEAD
\text{max}\!\left(\mindifficulty, {P(H)_H}_d + \diffadjustment\times\frontiermod + \expdiffsymb \right) & \text{if} \quad H_i<\mathit{TBD}\\
Copy link
Contributor

@jamesray1 jamesray1 Feb 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is changing anything compared to the latest (indeed it's outdated): \text{max}\!\left(\mindifficulty, {P(H)_{H}}_{\mathrm{d}} + \diffadjustment\times\homesteadmod + \expdiffsymb \right) & \text{otherwise}\\

=======
\text{max}\!\left(\mindifficulty, {P(H)_H}_d + \diffadjustment\times\frontiermod + \expdiffsymb \right) & \text{if} \quad H_i<\firsthomesteadblock\\
>>>>>>> upstream/master
\text{max}\!\left(\mindifficulty, {P(H)_H}_d + \diffadjustment\times\homesteadmod + \expdiffsymb \right) & \text{otherwise}\\
\end{dcases}
\end{equation}
Expand Down Expand Up @@ -769,11 +773,15 @@ \section{Message Call} \label{ch:call}
\boldsymbol{\sigma} & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \\
\boldsymbol{\sigma}^{**} & \text{otherwise}
\end{cases} \\
<<<<<<< HEAD
(\boldsymbol{\sigma}^{**}, g', \mathbf{s}, \mathbf{o}) & \equiv & \begin{cases}
Copy link
Contributor

@jamesray1 jamesray1 Feb 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we have:

yellowpaper/Paper.tex

Lines 817 to 829 in fb260c1

\begin{eqnarray}
\boldsymbol{\sigma}' & \equiv & \begin{cases}
\boldsymbol{\sigma} & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \\
\boldsymbol{\sigma}^{**} & \text{otherwise}
\end{cases} \\
g' & \equiv & \begin{cases}
0 & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \ \wedge \ \mathbf{o} = \varnothing \\
g^{**} & \text{otherwise}
\end{cases} \\ \nonumber
z & \equiv & \begin{cases}
0 & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \\
1 & \text{otherwise}
\end{cases} \\

I'm not sure what the benefit of including this is.

=======
g' & \equiv & \begin{cases}
0 & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \\
g^{**} & \text{otherwise}
\end{cases} \\
(\boldsymbol{\sigma}^{**}, g^{**}, \mathbf{s}, \mathbf{o}) & \equiv & \begin{cases}
>>>>>>> upstream/master
\Xi_{\mathtt{ECREC}}(\boldsymbol{\sigma}_1, g, I) & \text{if} \quad r = 1 \\
\Xi_{\mathtt{SHA256}}(\boldsymbol{\sigma}_1, g, I) & \text{if} \quad r = 2 \\
\Xi_{\mathtt{RIP160}}(\boldsymbol{\sigma}_1, g, I) & \text{if} \quad r = 3 \\
Expand Down Expand Up @@ -892,16 +900,26 @@ \subsubsection{Machine State}
\subsubsection{Exceptional Halting}

The exceptional halting function $Z$ is defined as:
\begin{equation}
Z(\boldsymbol{\sigma}, \boldsymbol{\mu}, I) \equiv
\begin{array}[t]{l}
\boldsymbol{\mu}_g < C(\boldsymbol{\sigma}, \boldsymbol{\mu}, I) \quad \vee \\
\mathbf{\delta}_w = \varnothing \quad \vee \\
\lVert\boldsymbol{\mu}_\mathbf{s}\rVert < \mathbf{\delta}_w \quad \vee \\
( w \in \{ \text{\small JUMP}, \text{\small JUMPI} \} \quad \wedge \\ \quad \boldsymbol{\mu}_\mathbf{s}[0] \notin D(I_\mathbf{b}) ) \quad \vee \\
\lVert\boldsymbol{\mu}_\mathbf{s}\rVert - \mathbf{\delta}_w + \mathbf{\alpha}_w > 1024 \quad
\end{array}
\end{equation}
%\begin{equation}
%Z(\boldsymbol{\sigma}, \boldsymbol{\mu}, I) \equiv
%\begin{array}[t]{l}
%\boldsymbol{\mu}_g < C(\boldsymbol{\sigma}, \boldsymbol{\mu}, I) \quad \vee \\
%\mathbf{\delta}_w = \varnothing \quad \vee \\
%\lVert\boldsymbol{\mu}_\mathbf{s}\rVert < \mathbf{\delta}_w \quad \vee \\
%( w \in \{ \text{\small JUMP}, \text{\small JUMPI} \} \quad \wedge \\ \quad \boldsymbol{\mu}_\mathbf{s}[0] \notin D(I_\mathbf{b}) ) \quad \vee \\
%\lVert\boldsymbol{\mu}_\mathbf{s}\rVert - \mathbf{\delta}_w + \mathbf{\alpha}_w > 1024 \quad
%\end{array}
%\end{equation}


\begin{gather}
Z(\boldsymbol{\sigma}, \boldsymbol{\mu}, I) \equiv \boldsymbol{\mu}_g < C(\boldsymbol{\sigma}, \boldsymbol{\mu}, I) \quad \vee \\
\mathbf{\delta}_w = \varnothing \quad \vee \nonumber \\
\lVert\boldsymbol{\mu}_\mathbf{s}\rVert < \mathbf{\delta}_w \quad \vee \nonumber \\
( w = \text{\small JUMP} \quad \wedge \quad \boldsymbol{\mu}_\mathbf{s}[0] \notin D(I_\mathbf{b}) ) \quad \vee \nonumber \\
( w = \text{\small JUMPI} \quad \wedge \quad \boldsymbol{\mu}_\mathbf{s}[1] \neq 0 \quad \wedge \quad \boldsymbol{\mu}_\mathbf{s}[0] \notin D(I_\mathbf{b}) ) \quad \vee \nonumber \\
Copy link
Contributor

@jamesray1 jamesray1 Feb 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@efaysal, I put 919-920 into #616

\lVert\boldsymbol{\mu}_\mathbf{s}\rVert - \mathbf{\delta}_w + \mathbf{\alpha}_w > 1024 \nonumber
\end{gather}

This states that the execution is in an exceptional halting state if there is insufficient gas, if the instruction is invalid (and therefore its $\delta$ subscript is undefined), if there are insufficient stack items, if a {\small JUMP}/{\small JUMPI} destination is invalid or the new stack size would be larger then 1024. The astute reader will realise that this implies that no instruction can, through its execution, cause an exceptional halt.

Expand Down Expand Up @@ -2151,7 +2169,11 @@ \subsubsection{Cache}
\text{with} \quad \mathbf{x'} = \mathbf{x} \quad \text{except} \quad \mathbf{x'}[j] = E_{rmh}(\mathbf{x}, j) \quad \forall \quad j < i
\end{multline}

<<<<<<< HEAD
\subsubsection{Full dataset calculation} \label{dataset}
=======
\subsubsection{Full dataset calculation} \label{dataset}
>>>>>>> upstream/master
Essentially, we combine data from $J_{parents}$ pseudorandomly selected cache nodes, and hash that to compute the dataset. The entire dataset is then generated by a number of items, each $J_{hashbytes}$ bytes in size:
\begin{equation}
\mathbf{d}[i] = E_{datasetitem}(\mathbf{c}, i) \quad \forall \quad i < \left\lfloor\frac{d_{size}}{J_{hashbytes}}\right\rfloor
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# yellowpaper

<<<<<<< HEAD
[![Gitter](https://badges.gitter.im/ethereum/yellowpaper.svg)](https://gitter.im/ethereum/yellowpaper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
=======
[![Gitter](https://badges.gitter.im/ethereum/yellowpaper.svg)](https://gitter.im/ethereum/yellowpaper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

The paper comes as a single ``latex`` file ``Paper.tex``. The latest version is generally available as a PDF at https://ethereum.github.io/yellowpaper/paper.pdf or just [yellowpaper.io](http://yellowpaper.io/) .

In order to build, use the supplied build script (``build.sh``). Following the first time, you can use the standard `pdflatex` tools like http://latex.informatik.uni-halle.de/latex-online/latex.php for compiling/preview. It can be viewed in ``PDF`` format after building.
>>>>>>> upstream/master
13 changes: 13 additions & 0 deletions travis_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
<<<<<<< HEAD
#!/usr/bin/env bash

set -e

SHA=`git rev-parse --verify HEAD`
=======
#!/bin/bash

set -e

SHA=`git rev-parse --short --verify HEAD`
>>>>>>> Deploy pdf from travis.

git config user.name "$COMMIT_AUTHOR"
git config user.email "$COMMIT_AUTHOR_EMAIL"
git checkout --orphan gh-pages
git rm --cached -r .
echo "# Automatic build" > README.md
echo "Built pdf from \`$SHA\`. See https://github.com/ethereum/yellowpaper/ for details." >> README.md
<<<<<<< HEAD
echo "The generated pdf is here: https://ethereum.github.io/yellowpaper/paper.pdf" >> README.md
echo '<html><head><meta http-equiv="refresh" content="0; url=paper.pdf" /></head><body></body></html>' > index.html
mv Paper.pdf paper.pdf
git add -f README.md index.html paper.pdf
=======
mv Paper.pdf paper.pdf
git add -f paper.pdf
>>>>>>> Deploy pdf from travis.
git commit -m "Built pdf from {$SHA}."

ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
Expand Down