-
Notifications
You must be signed in to change notification settings - Fork 27
Conversation
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.
LGTM
@@ -35,60 +35,47 @@ extern "C" { | |||
#[repr(C, align(256))] | |||
struct MemoryLeaf([u8; 32]); | |||
|
|||
/// Compiles and instruments a user wasm. | |||
/// Instruments a user wasm. |
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.
Instruments and activates
?
sp: usize, | ||
) { | ||
let mut sp = GoStack::new(sp); | ||
let wasm = sp.read_go_slice_owned(); | ||
let page_limit = sp.read_u16(); | ||
let version = sp.read_u16(); | ||
let debug = sp.read_bool32(); | ||
let (out_hash_ptr, out_hash_len) = sp.read_go_slice(); | ||
let module_hash = sp.read_go_ptr(); | ||
let gas = sp.read_go_ptr(); |
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.
maybe add comment about modules_hash
being output, gas
being input & output
arbos/programs/programs.go
Outdated
@@ -342,7 +337,7 @@ func (p Programs) setProgram(codehash common.Hash, program Program) error { | |||
if err != nil { | |||
return err | |||
} | |||
return p.compiledHashes.Set(codehash, program.compiledHash) | |||
return p.compiledHashes.Set(codehash, program.moduleHash) |
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.
update p.compiledHashes
to p.moduleHashes
?
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.
LGTM
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.
LGTM
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.
LGTM
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.
A couple minor additional comments but largely LGTM
arbos/programs/native.go
Outdated
@@ -93,6 +93,7 @@ func activateProgram( | |||
func callProgram( | |||
address common.Address, | |||
program Program, |
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.
This program
parameter is no longer used now that moduleHash
is passed in separately.
arbos/burn/burn.go
Outdated
@@ -13,7 +13,7 @@ import ( | |||
type Burner interface { | |||
Burn(amount uint64) error | |||
Burned() uint64 | |||
GasLeft() *uint64 | |||
GasLeft() *uint64 // SystemBurner's panic |
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.
The apostrophe doesn't read well to me, could you do
// `SystemBurner`s panic
instead?
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.
LGTM
This PR leverages the new onchain module hash to make a number of simplifications and improvements
This PR includes conceptual changes that will be easier to track by adopting the following nomenclature.
Associated PRs