-
Notifications
You must be signed in to change notification settings - Fork 112
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
[WIP]Updated VM With Contracts #1598
base: main
Are you sure you want to change the base?
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.
I don't think this belongs here
2fd9b43
to
1c0dffa
Compare
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.
Bunch of comments... not all of them need to be addressed by any stretch.
I think there are definitely a few things that we can improve over the other existing examples.
|
||
// Specify all statekeys Execute can touch | ||
func (c *Call) StateKeys(actor codec.Address, actionID ids.ID) state.Keys { | ||
return state.Keys{} |
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.
I'm guessing this is a TODO?
This needs to be part of the Call
struct, I'm pretty sure.
// prefix's all contract related keys | ||
contractPrefix = 0x4 | ||
contractBytePrefix = 0x5 | ||
// prefix's all contract state keys | ||
contractStatePrefix = 0x0 | ||
// contract bytes prefixc, prefix's ids -> contract bytes | ||
// contract state prefix, prefix's ids -> contract state | ||
// contract ID prefix[ contractPrefix -> contractIDPrefix ] | ||
contractIDPrefix = 0x2 |
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.
Any thoughts on putting this stuff in the runtime
package?
func HeightKey() (k []byte) { | ||
return heightKey | ||
} | ||
|
||
func TimestampKey() (k []byte) { | ||
return timestampKey | ||
} | ||
|
||
func FeeKey() (k []byte) { | ||
return feeKey | ||
} |
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.
These variables aren't used anywhere else, any reason not to inline them?
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.
Seems weird that this is part of the vm
package
} | ||
reply.Amount = balance | ||
return err | ||
} |
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 whole thing needs to be spun out into an rpc
package
|
||
// When registering new auth, ALWAYS make sure to append at the end. | ||
AuthParser.Register(&auth.ED25519{}, auth.UnmarshalED25519), | ||
AuthParser.Register(&auth.SECP256R1{}, auth.UnmarshalSECP256R1), |
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 do we use two different curves?
TODOS