Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Add SWAPX spec #48

Merged
merged 5 commits into from
Oct 15, 2021
Merged

Conversation

scroll-dev
Copy link
Contributor

No description provided.

Copy link
Contributor

@miha-stopar miha-stopar left a comment

Choose a reason for hiding this comment

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

Nice! Commented just some minor things.

@@ -0,0 +1,24 @@
# SWAPX op code
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's good if we make the names of opcode files consistent - we first had it 26BYTE.md and 50POP.md, so I suggest having 90SWAPX.md here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

adjust file name now

@@ -0,0 +1,24 @@
# SWAPX op code
## Procedure
swapx represents op codes of swap1....swap16. which swaps the top of the stack with the 'x+1'th last element. for exmaple, SWAP3 means swaping the top of the stack with the 4th last element
Copy link
Contributor

Choose a reason for hiding this comment

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

There are some typos like "exmaple" and capitalisation of letters.

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed


## Exceptions
1. gas out: remaining gas is not enough
2. stack underflow: when stack length is less than swap position 'x + 1', i.e stack have 3 elements but swap4 or more
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps "i.e stack have 3 elements but swap4 or more" -> "i.e stack have 3 elements but the op is swap3, swap4, ..., swap16.".

Copy link
Collaborator

@DreamWuGit DreamWuGit Oct 14, 2021

Choose a reason for hiding this comment

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

should be more clear & updated

Copy link
Collaborator

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

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

LGTM

@miha-stopar miha-stopar merged commit aa67625 into privacy-scaling-explorations:master Oct 15, 2021
@icemelon icemelon deleted the swapx branch March 18, 2022 03:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants