-
Notifications
You must be signed in to change notification settings - Fork 572
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
initializes service:bridge-relay command #4314
initializes service:bridge-relay command #4314
Conversation
adds a service command to act as a relay; decrypting deposit transactions on Iron Fish and calling the bridge contract on Ethereum relies on remote node to decrypt transactions with a given view key via chain/getTransactionStream waits until block confirmed before processing deposit transactions
}), | ||
viewKey: Flags.string({ | ||
char: 'k', | ||
description: 'View key to watch transactions with', |
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.
We should label this as incoming view key, since we have the concept of a "view key" which has functionality of both ivk and ovk (see --export json)
|
||
const committing = buffer.length > confirmations | ||
|
||
this.log( |
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 is gonna be a lot of log lines, currently 220k, just fyi
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.
yeah this was just copied from the sync command
we can make this a debug-level log or remove it
for (const note of transaction.notes) { | ||
this.log(`Processing deposit ${note.memo}, from transaction ${transaction.hash}`) | ||
// TODO: get Eth deposit address from API | ||
// TODO: call Eth bridge contract to mint |
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.
What happens if commit is being performed and process is killed. Then it was restarted, the head hash would be for a partially processed block? We could potentially reprocess notes right? Seems like not a big deal for prototyping, just keeping it in mind for external service calls during processing of chain.
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.
we probably need to store some status on the deposits -- if the process stops in the middle of a block then we don't want to reprocess deposits that we've already invoked the Eth contract for
viewKey and incomingViewKey are two different keys, so we should keep the terms clear
changes 'service:bridge-relay' to 'service:bridge:relay' we expect to implement at least one more bridge service command
* initializes service:bridge-relay command adds a service command to act as a relay; decrypting deposit transactions on Iron Fish and calling the bridge contract on Ethereum relies on remote node to decrypt transactions with a given view key via chain/getTransactionStream waits until block confirmed before processing deposit transactions * renames viewKey to incomingViewKey viewKey and incomingViewKey are two different keys, so we should keep the terms clear * changes progress log to debug * changes head arg to fromHead flag * creates bridge sub-namespace in service commands changes 'service:bridge-relay' to 'service:bridge:relay' we expect to implement at least one more bridge service command
Summary
adds a service command to act as a relay; decrypting deposit transactions on Iron Fish and calling the bridge contract on Ethereum
relies on remote node to decrypt transactions with a given view key via chain/getTransactionStream
waits until block confirmed before processing deposit transactions
Testing Plan
manual testing:
Documentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.