Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

EIP 145 - Shift opcodes #43

Closed
wants to merge 8 commits into from
Closed

Conversation

dziabko
Copy link

@dziabko dziabko commented May 31, 2019

Implemented EIP 145 (SAR, SHR, SHL opcodes). Implemented instruction_test.go file for basic tests. Added IsAghartha check. All tests pass for stShift test cases except for one specific test. Raised an issue for that test (#42 ).

@dziabko dziabko requested a review from noot as a code owner May 31, 2019 18:30
@dziabko dziabko changed the title Finished SAR, SHR, SHL opcodes. EIP 145 EIP 145 - Shift opcodes May 31, 2019
@@ -166,6 +167,13 @@ type StateTest struct {
Post map[string][]stPostState `json:"post"`
}

type ShiftTest struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't used anywhere ?

@austinabell
Copy link
Contributor

Should rebase with development, operation function signatures do not match primarily and need to resolve conflicts

}

testTwoOperandOp(t, tests, opSAR, "sar")
}
Copy link
Contributor

@austinabell austinabell May 31, 2019

Choose a reason for hiding this comment

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

Did it not work out cleanly to add in the tests from the testdata directory (from ETH as well) to include with these? These tests included should be sufficient, just curious

@noot
Copy link
Contributor

noot commented May 31, 2019

@dziabko please fix conflicts

@@ -273,7 +274,50 @@ func opMulmod(pc *uint64, env Environment, contract *Contract, memory *Memory, s
return nil, nil
}

func opSha3(pc *uint64, env Environment, contract *Contract, memory *Memory, stack *stack) ([]byte, error) {
func opSHL(instr instruction, pc *uint64, env Environment, contract *Contract, memory *Memory, stack *stack) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Build is failing because the function signature doesn't match the updated. Add the ([]byte, error) return to the signature and return those values respectively (nil returns for all changed functions including the opSha3 that was changed)

Copy link
Contributor

Choose a reason for hiding this comment

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

why is instr instruction added as an argument?

Copy link
Contributor

Choose a reason for hiding this comment

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

that's what it used to be, this is the old function signature

Copy link
Contributor

Choose a reason for hiding this comment

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

it's also preventing build since he's passing these in as instrFn in the jump table, so either we remove that field or we add an additional field to instrFn and all the other opcodes

@@ -22,6 +22,7 @@ import (

"github.com/eth-classic/go-ethereum/common"
"github.com/eth-classic/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/common/math"
Copy link
Contributor

@steviezhang steviezhang Jun 5, 2019

Choose a reason for hiding this comment

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

remove autoimport

@GregTheGreek
Copy link

I think we should PR this into a different branch, or move development into staging (for the testnet) so we dont confuse agharta changes with atlantis

@soc1c
Copy link
Contributor

soc1c commented Jun 6, 2019

@GregTheGreek #47

}

func opSHR(instr instruction, pc *uint64, env Environment, contract *Contract, memory *Memory, stack *stack) {
shift, value := math.U256(stack.pop()), math.U256(stack.pop())
Copy link
Contributor

Choose a reason for hiding this comment

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

remove references to math package

@soc1c
Copy link
Contributor

soc1c commented Jun 17, 2019

What's the status of this?

@soc1c
Copy link
Contributor

soc1c commented Jun 17, 2019

Putting on ice so we can focus on Atlantis releases for now

@soc1c
Copy link
Contributor

soc1c commented Jun 18, 2019

closing as stale

@soc1c soc1c closed this Jun 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants