-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feat: implement bitcoin relayer #432
base: main
Are you sure you want to change the base?
Conversation
…wallet (#2) * feat: add transmission and bitcoin module --------- Co-authored-by: k0r1 <[email protected]>
Add Bitcoin taproot multisig wallet library
…wallet (#2) * feat: add transmission and bitcoin module --------- Co-authored-by: k0r1 <[email protected]>
|
||
for { | ||
select { | ||
case <-pollHeightTicker.C: |
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.
Add sleep or avoid using default so that the cpus usage would not be 100% within the loop.
|
||
heightStream := p.getHeightStream(done, fromHeight, toHeight) | ||
|
||
diff := int(toHeight-fromHeight) / 2 |
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.
Similar implementation on other chains have been reverted to use simpler single threaded executions to avoid hitting rate limit in RPCs when numerous blocks are missing. So, it would be better to refactor this as well
@@ -0,0 +1,1437 @@ | |||
package bitcoin |
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.
please consider refactoring this file to multiple files(listener,routes,tx and so on) to avoid creating too large file.
} | ||
|
||
func (p *Provider) FetchTxMessages(ctx context.Context, txHash string) ([]*relayTypes.Message, error) { | ||
return nil, nil |
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.
Add implementation here to fetch transaction based on any given txHash if possible as it would make manual replaying transaction much simpler and effective based on tx hash.
p.logger.Info("Message stored in LevelDB", zap.String("key", string(key)), zap.Any("message", message)) | ||
|
||
if p.cfg.Mode != MasterMode { | ||
return nil |
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.
Call the callback for cleaning the message status since this won't process this,
for _, block := range blockInfo { | ||
messages = append(messages, block.Messages...) | ||
} | ||
blockInfoChan <- &relayTypes.BlockInfo{ |
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.
Doesn't this make sense only for the master mode to push to the channel since the icon chain will route the message pushed here ?
|
||
for i := param.StartHeight; i <= param.EndHeight; i++ { | ||
|
||
blockHash, err := c.client.GetBlockHash(int64(i)) |
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.
Can we simplify polling by just getting the address history txn of relayer address and then fetching the transaction directly or this approach just won;t work ?
Description:
Features:
Docs:
Including testing results and how to use bitcoin relayer
Mainnet contracts:
Checklist:
(https://github.com/icon-project/community/blob/main/guidelines/technical/software-development-guidelines.md#commit-messages)