-
Notifications
You must be signed in to change notification settings - Fork 90
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
Change ed19
to work with arbitrary-length messages
#795
Changes from 46 commits
41d1d50
34a23f8
3f233a3
f47cddd
296e307
66023ef
d62708e
9f84f36
c316e33
04e97f1
56c8f84
586ece5
cc55e94
7c0a013
08041d8
98bdbc8
75e3149
2b39ae9
0e0e79c
862687e
578b6b6
d42c469
3570b60
2220fb5
476f2f4
509cb57
a977954
443f12d
3a9f032
c844fe4
519839f
fd48197
24e3b0d
f7f70ae
9c945c7
7e2d619
d741a42
f964db6
6de7874
1bfa69b
4f0a032
e9a87d4
75ab1a1
6e72acc
3bc3a86
6a155a0
1c56802
eb11817
a884c4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ where | |
)) | ||
})?, | ||
); | ||
if pc < self.registers[RegId::IS] || pc >= self.registers[RegId::SSP] { | ||
if pc < self.registers[RegId::IS] || pc >= self.registers[RegId::SP] { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this get changed to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR originially included changes from an old version of the Blob TX PR. Git merged this part incorrectly and I missed it when reviewing the code myself. Removed in 1c56802. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I re-reviewed myself as well to make sure nothing else was missed. |
||
return Err(InterpreterError::PanicInstruction(PanicInstruction::error( | ||
PanicReason::MemoryNotExecutable, | ||
instruction, | ||
|
@@ -845,9 +845,16 @@ where | |
} | ||
|
||
Instruction::ED19(ed19) => { | ||
self.gas_charge(self.gas_costs().ed19())?; | ||
let (a, b, c) = ed19.unpack(); | ||
self.ed25519_verify(r!(a), r!(b), r!(c))?; | ||
let (a, b, c, len) = ed19.unpack(); | ||
let mut len = r!(len); | ||
|
||
// Backwards compatibility with old contracts | ||
if len == 0 { | ||
len = 32; | ||
} | ||
|
||
self.dependent_gas_charge(self.gas_costs().ed19(), len)?; | ||
self.ed25519_verify(r!(a), r!(b), r!(c), len)?; | ||
} | ||
|
||
Instruction::K256(k256) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was it
HeavyOperation
before, butLightOperation
now?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably just an oversight. Brandon was wonderin which one it should be, and changing it seemed to make sense. #795 (comment)