-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Keystone: EVM write capability + forwarder contract #12045
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
|
||
// Keystone | ||
|
||
//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin KeystoneForwarder forwarder |
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.
NOTE: getting the solc compiler wrapper working was really tedious so I ended up using forge build --extra-output-files abi
then abigen --abi ../../../contracts/foundry-artifacts/KeystoneForwarder.sol/KeystoneForwarder.abi.json --pkg forwarder --out generated/forwarder/forwarder.go
Go solidity wrappers are out-of-date, regenerate them via the |
config, err := values.NewMap(map[string]any{ | ||
"abi": "receive(report bytes)", | ||
"params": []any{"$(report)"}, | ||
}) | ||
require.NoError(t, err) | ||
|
||
inputs, err := values.NewMap(map[string]any{ | ||
"report": []byte{1, 2, 3}, | ||
}) | ||
require.NoError(t, 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.
See here for example inputs and config
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.
Some initial comments.
} | ||
|
||
// abi.encodeWithSelector(bytes4 selector, data...) | ||
(bool success, bytes memory result) = targetAddress.call(data); |
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 can revert, should we call it in try-catch so that s_reports gets updated regardless?
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.
address.call
actually doesn't revert, that's why there's the bool success
parameter! Had to double check, compiler won't actually accept try targetAddress.call(data) returns (bool success, bytes memory result)
err := method.Inputs.UnpackIntoMap(payload, req.EncodedPayload[4:]) | ||
require.NoError(t, err) | ||
require.Equal(t, []byte{ | ||
0xa6, 0x9b, 0x6e, 0xd0, // selector = keccak(signature)[:4] |
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.
Prefer a hex-encoded string for readability.
|
||
txMeta := &txmgr.TxMeta{ | ||
// FwdrDestAddress: , | ||
WorkflowExecutionID: &request.Metadata.WorkflowExecutionID, |
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 need this? Is TXM going to do anything special with the ID?
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 tx has a SignalCallback
field that's currently used by the broadcaster to call into the task pipeline to resume a pipeline when a tx is confirmed. I'm planning to adjust that logic so that if there's a execution ID set, it'll instead call into the capability which will then send a result down the channel
2f69a67
to
064a80b
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
064a80b
to
9445fe8
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
9445fe8
to
3f1c19d
Compare
3f1c19d
to
70e5f97
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
1 similar comment
Go solidity wrappers are out-of-date, regenerate them via the |
70e5f97
to
6b07da8
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
1576afd
to
099733f
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
1 similar comment
Go solidity wrappers are out-of-date, regenerate them via the |
5dffec0
to
b446d96
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
411b334
to
523cb16
Compare
523cb16
to
2b1dfdb
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
1 similar comment
Go solidity wrappers are out-of-date, regenerate them via the |
fd662f3
to
ac2675f
Compare
Quality Gate passedIssues Measures |
No description provided.