-
Notifications
You must be signed in to change notification settings - Fork 227
AMB Home-to-Foreign async calls #570
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
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.
Let's think of this feature more.
-
Imagine that we would like to get not only information provided by a method call, but also some data which cannot be received within a contract execution environment. E.g. what a block hash for the block with the number X, or whether a transaction Y is in a blockchain, or does a token Z was indeed transferred from Alice to Bob? What if
requireToGetInformation
is extended by an ability to specify a selector of an RPC call whereeth_call
is just one of them (e.g.bytes4(keccak256("eth_call"))
)? The AMB oracles will call the corresponding RPC with specified parameters assuming that some predefined format of the return value exists for specific RPC calls (most probably ABI v2 will be required to encode the return value on the oracle side and to decode it on the contract-recipient side). -
Does it makes sense to specify a method selector that must be called as a callback instead of assuming that it will by always
onInformationReceived(bytes32,bool,bytes)
. The reason is that some contract would like to have more specific response likeonInformationReceived(bytes32,bool,uint256)
oronInformationReceived(bytes32,bool,bytes32)
. Moreover, since the contract receiving the data can be prepared with the pragmaABIEncoderV2
, the input data could be quite complex (take a look at https://gist.github.com/akolotov/7ecccc0914af4869825f275305dbcf69). That's why consider a suggestion to expect the method selector from the invoking contract assuming that first two parameters of this method aremessageId
andstatus
.
What do you think?
Another thing to think (or at lease to provide reasoning) whether we need:
|
Do you think it also makes sense to allow users to specify the exact timestamp/block number for the async call for oracles to use? Should we allow to make eth_call at the particular block in the past?
I agree that in order to support different async call types, we should use
Not sure about the confirmInformation and handleMessage for now, will be clear later on. But as for event, I am sure that we need a separate event for information requests. This will not break any existing monitoring tools, which expect 1-to-1 correspondence between |
It could make sense in the following flow:
|
Agree
Agree -- the separate event will protect from modifying existing bridge tooling. But if I develop a standard for AMB I would have the same event for both types of messages. |
ccebf8c
to
2191240
Compare
So, I have considered a way of supporting custom block requests (e.g. |
This set of changes includes the following improvements and fixes: * [Improvement] AMB Home-to-Foreign async calls (#570), closes #492 * [Improvement] Add GSN support for erc20-to-native bridge mode (#571) * [Fix] Fix issues with packages versions and linter (#600) * [Other] Bump package version before 6.0.0-rc0 (#598)
Closes #492