Skip to content
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: parse inscription like witness data #2524

Merged
merged 24 commits into from
Jul 30, 2024

Conversation

bitSmiley
Copy link
Contributor

@bitSmiley bitSmiley commented Jul 21, 2024

Description

This is the start of a series of PRs that implements the solution mentioned in #2478. The implementation is broken down into several parts:

  • Extract memo from the witness script (This PR)
  • Detect targetted zeta btc address and extract corresponding witness script
  • Javascript client that submits inscription transactions
  • Integration testing in code base and in mainet

This PR adds a DecodeScript function that decodes memo wrapped in an inscription-like script. The format of the script is following that of "inscription" defined in ordinal theory. However, to separate from inscription (as this use case is not an NFT), simplifications are made. The bitcoin envelope script is as follows:

OP_DATA_32 <32 byte of public key> OP_CHECKSIG
OP_FALSE
OP_IF
  OP_PUSH 0x...
  OP_PUSH 0x...
OP_ENDIF

The public key is the internalKey used in the taproot transaction. This follows ord.

The DecodeScript method take the script bytes and parse them according. Internally it is utilizing ScriptTokenizer. Ideally, it should directly use txscript.ScriptTokenizer, however, the current codebase does not have the versions for ScriptTokenizer. A simplified version is used. If btcsuite is upgraded, then scriptTokenizer can be removed and the code base will be simplified further.

// There are no content-type or any other attributes, it's just raw bytes.

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced Bitcoin event processing with a new function to handle transactions containing witness data.
    • Added functionalities for decoding Bitcoin scripts, improving the robustness and validation of transaction scripts.
  • Tests

    • Introduced a comprehensive test suite for the new script decoding functionality, validating various scenarios and error conditions.

Copy link
Contributor

coderabbitai bot commented Jul 21, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Walkthrough

The update enhances Bitcoin transaction processing by introducing methods for handling witness data and decoding scripts. The new function GetBtcEventWithWitness prioritizes OP_RETURN data extraction while setting the stage for future tapscript parsing. Additional functions improve script decoding, ensuring structured handling, validating expected opcodes, and confirming public key presence. The overall changes bolster robustness and error handling within the Bitcoin client.

Changes

Files Change Summary
zetaclient/chains/bitcoin/observer/inbound.go Added GetBtcEventWithWitness for handling witness data in Bitcoin transactions.
zetaclient/chains/bitcoin/tx_script.go Introduced functions for decoding scripts and validating structure, including DecodeScript, decodeInscriptionPayload, and checkInscriptionEnvelope. Added scriptTokenizer type for improved script parsing.
zetaclient/chains/bitcoin/tokenizer.go New scriptTokenizer struct and methods for parsing Bitcoin scripts effectively.
zetaclient/chains/bitcoin/tx_script_test.go Added TestDecodeScript to validate new decoding functionalities across multiple scenarios.

Possibly related issues

🐰 "In the realm of code where rabbits do hop,
New functions and scripts make our workflow pop!
With witness and scripts in a dance so neat,
We celebrate changes that can’t be beat!
Hop along, dear coder, let’s make it bright,
For every new feature, we’ll code through the night!" 🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@bitSmiley bitSmiley changed the title parse inscription like witness data feat: parse inscription like witness data Jul 21, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between df6ff86 and 2751889.

Files selected for processing (3)
  • zetaclient/chains/bitcoin/observer/inbound.go (1 hunks)
  • zetaclient/chains/bitcoin/tx_script.go (3 hunks)
  • zetaclient/chains/bitcoin/tx_script_test.go (1 hunks)
Additional context used
Path-based instructions (3)
zetaclient/chains/bitcoin/observer/inbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/bitcoin/tx_script.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/bitcoin/tx_script_test.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Additional comments not posted (3)
zetaclient/chains/bitcoin/observer/inbound.go (1)

476-510: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to GetBtcEventWithWitness are correctly implemented.

zetaclient/chains/bitcoin/tx_script.go (1)

340-345: LGTM!

The code changes are approved.

zetaclient/chains/bitcoin/tx_script_test.go (1)

495-556: LGTM! Consider adding more edge cases for comprehensive testing.

The code changes are approved.

For comprehensive testing, consider adding more edge cases, such as:

  1. Scripts with unexpected opcodes.
  2. Scripts with valid but irrelevant data.
  3. Scripts with nested structures.

zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the start of a series of PRs that implements the solution mentioned in #2478. The implementation is broken down into several parts:

Sounds good. For task that can be broken down in subset, we usually create issue tagged as epic

Example #2506

zetaclient/chains/bitcoin/tx_script.go Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
Copy link
Contributor

@swift1337 swift1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing! Looks awesome, left some comments.

zetaclient/chains/bitcoin/observer/inbound.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/observer/inbound.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/observer/inbound.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script_test.go Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
zetaclient/chains/bitcoin/observer/inbound.go (2)

476-479: Extend the function comments.

The comments should provide a complete description of the function's purpose and behavior, including the format of the tapscript.

-// The format of the tapscript is
+// The format of the tapscript is as follows:
+// <description of the tapscript format>

500-501: Improve error handling for clarity.

The comment "should never happen" is not informative. Provide a more descriptive error message.

-if err != nil { // should never happen
-  return nil, errors.Wrap(err, "unable to get btc event")
+if err != nil {
+  return nil, errors.Wrap(err, "failed to get BTC event, unexpected error")
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2751889 and 6dbb635.

Files selected for processing (2)
  • zetaclient/chains/bitcoin/observer/inbound.go (1 hunks)
  • zetaclient/chains/bitcoin/tx_script.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • zetaclient/chains/bitcoin/tx_script.go
Additional context used
Path-based instructions (1)
zetaclient/chains/bitcoin/observer/inbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/bitcoin/observer/inbound.go Show resolved Hide resolved
@bitSmiley
Copy link
Contributor Author

@lumtis @swift1337 I have addressed the review feedbacks. I'm not familiar with the "resolve" convention you have, so I just leave them open first. Please take another look and let me know.

Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need to run

make generate

in the repo and commit the changes

@bitSmiley bitSmiley force-pushed the feat-btc_inscription branch from 7affe31 to 1c7c094 Compare July 25, 2024 09:29
@bitSmiley
Copy link
Contributor Author

@lumtis Ran make generate and pushed the results

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6dbb635 and 1c7c094.

Files selected for processing (3)
  • zetaclient/chains/bitcoin/observer/inbound.go (1 hunks)
  • zetaclient/chains/bitcoin/tokenizer.go (1 hunks)
  • zetaclient/chains/bitcoin/tx_script.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • zetaclient/chains/bitcoin/observer/inbound.go
Additional context used
Path-based instructions (2)
zetaclient/chains/bitcoin/tokenizer.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/bitcoin/tx_script.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Learnings (1)
zetaclient/chains/bitcoin/tx_script.go (1)
Learnt from: lumtis
PR: zeta-chain/node#2524
File: zetaclient/chains/bitcoin/tx_script.go:280-324
Timestamp: 2024-07-22T10:48:05.549Z
Learning: Refactor loop structures in Go code for better readability by using the `for t.Next()` pattern instead of a `for { if !t.Next() { ... } }` pattern where applicable.
Additional comments not posted (10)
zetaclient/chains/bitcoin/tokenizer.go (7)

10-15: LGTM!

The function correctly initializes the scriptTokenizer struct.


21-27: LGTM!

The scriptTokenizer struct is well-defined and includes necessary fields for script tokenization.


31-33: LGTM!

The Done function correctly checks if the tokenizer has completed processing the script.


37-39: LGTM!

The Data function correctly returns the data associated with the most recently parsed opcode.


43-45: LGTM!

The Err function correctly returns any errors associated with the tokenizer.


48-50: LGTM!

The Opcode function correctly returns the current opcode associated with the tokenizer.


68-155: LGTM! Consider adding more context to error messages.

The Next function correctly handles multiple cases for different opcodes and includes error handling.

For better debugging, consider adding more context to the error messages.

-  t.err = fmt.Errorf("opcode %d requires %d bytes, but script only has %d remaining", op, length, len(script))
+  t.err = fmt.Errorf("Next: opcode %d requires %d bytes, but script only has %d remaining", op, length, len(script))
-  t.err = fmt.Errorf("unexpected op code %d", op)
+  t.err = fmt.Errorf("Next: unexpected op code %d", op)
-  t.err = fmt.Errorf("opcode %d pushes %d bytes, but script only has %d remaining", op, dataLen, len(script))
+  t.err = fmt.Errorf("Next: opcode %d pushes %d bytes, but script only has %d remaining", op, dataLen, len(script))
-  t.err = fmt.Errorf("invalid opcode length %d", length)
+  t.err = fmt.Errorf("Next: invalid opcode length %d", length)
zetaclient/chains/bitcoin/tx_script.go (3)

210-223: LGTM! Consider adding more context to error messages.

The DecodeScript function is well-structured and correctly decodes the memo wrapped in an inscription-like script.

For better debugging, consider adding more context to the error messages.

-  return nil, false, errors.Wrap(err, "checkInscriptionEnvelope: unable to check the envelope")
+  return nil, false, errors.Wrap(err, "DecodeScript: checkInscriptionEnvelope: unable to check the envelope")
-  return nil, false, errors.Wrap(err, "decodeInscriptionPayload: unable to decode the payload")
+  return nil, false, errors.Wrap(err, "DecodeScript: decodeInscriptionPayload: unable to decode the payload")

279-304: LGTM! Consider adding more context to error messages and refactoring the loop structure.

The decodeInscriptionPayload function is well-structured and correctly processes the script.

For better debugging, consider adding more context to the error messages.

-  return nil, fmt.Errorf("OP_FALSE not found")
+  return nil, fmt.Errorf("decodeInscriptionPayload: OP_FALSE not found")
-  return nil, fmt.Errorf("OP_IF not found")
+  return nil, fmt.Errorf("decodeInscriptionPayload: OP_IF not found")
-  return nil, fmt.Errorf("expecting data push, found %d", next)
+  return nil, fmt.Errorf("decodeInscriptionPayload: expecting data push, found %d", next)
-  return nil, fmt.Errorf("should contain more data, but script ended")
+  return nil, fmt.Errorf("decodeInscriptionPayload: should contain more data, but script ended")

For better readability, consider refactoring the loop structure.

-  for t.Next() {
-    next = t.Opcode()
-    if next == txscript.OP_ENDIF {
-      return memo, nil
-    }
-    if next < txscript.OP_DATA_1 || next > txscript.OP_PUSHDATA4 {
-      return nil, fmt.Errorf("decodeInscriptionPayload: expecting data push, found %d", next)
-    }
-    memo = append(memo, t.Data()...)
-  }
-  if t.Err() != nil {
-    return nil, t.Err()
-  }
-  return nil, fmt.Errorf("decodeInscriptionPayload: should contain more data, but script ended")
+  for t.Next() {
+    next = t.Opcode()
+    if next == txscript.OP_ENDIF {
+      return memo, nil
+    }
+    if next < txscript.OP_DATA_1 || next > txscript.OP_PUSHDATA4 {
+      return nil, fmt.Errorf("decodeInscriptionPayload: expecting data push, found %d", next)
+    }
+    memo = append(memo, t.Data()...)
+  }
+  if t.Err() != nil {
+    return nil, t.Err()
+  }
+  return nil, fmt.Errorf("decodeInscriptionPayload: should contain more data, but script ended")

308-317: LGTM! Consider adding more context to error messages.

The checkInscriptionEnvelope function is well-structured and correctly checks the opcodes.

For better debugging, consider adding more context to the error messages.

-  return fmt.Errorf("cannot obtain public key bytes op %d or err %s", t.Opcode(), t.Err())
+  return fmt.Errorf("checkInscriptionEnvelope: cannot obtain public key bytes op %d or err %s", t.Opcode(), t.Err())
-  return fmt.Errorf("cannot parse OP_CHECKSIG, op %d or err %s", t.Opcode(), t.Err())
+  return fmt.Errorf("checkInscriptionEnvelope: cannot parse OP_CHECKSIG, op %d or err %s", t.Opcode(), t.Err())

zetaclient/chains/bitcoin/observer/inbound.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Outdated Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Show resolved Hide resolved
zetaclient/chains/bitcoin/tx_script.go Show resolved Hide resolved
@bitSmiley
Copy link
Contributor Author

@fbac I have updated based on your feedbacks. Please help take a look.

@bitSmiley bitSmiley requested a review from fbac July 30, 2024 03:43
@fbac
Copy link
Contributor

fbac commented Jul 30, 2024

@fbac I have updated based on your feedbacks. Please help take a look.

Thank you for the changes, it looks good to me now. Could you fix the two errors concatenating strings and expand the comment where we add 1? After that this can be merged!

@bitSmiley
Copy link
Contributor Author

@fbac Updated so. Funny thing, seems like my IDE added that concatenation, fix that already.

Copy link
Contributor

@fbac fbac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

zetaclient/chains/bitcoin/tokenizer.go Show resolved Hide resolved
zetaclient/chains/bitcoin/tokenizer.go Show resolved Hide resolved
bitSmiley and others added 20 commits July 30, 2024 16:14
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
@fbac fbac force-pushed the feat-btc_inscription branch from 403ad80 to abf043d Compare July 30, 2024 14:14
@fbac
Copy link
Contributor

fbac commented Jul 30, 2024

Rebasing the branch with main, if we pass all the checks this will be merged.

Also @bitSmiley could you update the changelog introducing this change?

@fbac fbac added this pull request to the merge queue Jul 30, 2024
Merged via the queue into zeta-chain:develop with commit 6e9dc53 Jul 30, 2024
20 checks passed
@bitSmiley bitSmiley deleted the feat-btc_inscription branch July 31, 2024 03:21
gartnera pushed a commit that referenced this pull request Aug 15, 2024
* parse inscription like witness data

* more comment

* remove unused code

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pull origin

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* review feedbacks

* update review feedbacks

* update make generate

* fix linter

* remove over flow

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* update review feedback

* update code commnet

* update comment

* more comments

* Update changelog.md

---------

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

fix version
gartnera added a commit that referenced this pull request Aug 16, 2024
* feat: parse inscription like witness data (#2524)

* parse inscription like witness data

* more comment

* remove unused code

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pull origin

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* review feedbacks

* update review feedbacks

* update make generate

* fix linter

* remove over flow

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* update review feedback

* update code commnet

* update comment

* more comments

* Update changelog.md

---------

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

fix version

* feat: detect memo in btc txn from OP_RETURN and inscription (#2533)

* parse inscription like witness data

* more comment

* remove unused code

* parse inscription

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pull origin

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* review feedbacks

* update review feedbacks

* add mainnet txn

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* parse inscription like witness data

* more comment

* remove unused code

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pull origin

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* review feedbacks

* update review feedbacks

* update make generate

* fix linter

* remove over flow

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* update review feedback

* update code commnet

* update comment

* more comments

* Update changelog.md

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* clean up

* format code

---------

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* refactor(zetaclient)!: improve AppContext (#2568)

* Implement chain registry

* Rewrite test-cases for AppContext

* Drop `supplychecker`

* Refactor app ctx Update worker

* Refactor orchestrator

* Refactor observer&signer; DROP postBlockHeaders

* Fix test cases [1]

* Update changelog

* Allow Zeta Chain in appContext; address PR comments [1]

* Fix app context update

* Check for `chain.IsZeta()`

* Add AppContext.FilterChains

* Fix test cases [2]

* Fix test cases [3]

* Address PR comments [1]

* Address PR comments [2]

* Add tests for `slices`

* Fix e2e tests [1]

* Fix e2e tests [2]

* Resolve conflicts, converge codebase between PRs

* Add lodash; remove slices pkg

* Address PR comments

* Minor logging fix

* Address PR comments

tmp

* feat(zetaclient): add generic rpc metrics (#2597)

* feat(zetaclient): add generic rpc metrics

* feedback

* changelog

* fmt

* fix(zetaclient): use name in pending tx metric (#2642)

* feat(pkg): add `ticker` package (#2617)

* Add `pkg/ticker`

* Sample ticker usage in evm observer

* Change naming

* Address PR comments

* Address PR comments

* feat(zetaclient)!: Add support for EIP-1559 gas fees (#2634)

* Add Gas struct

* Add EIP-1559 fees

* Update changelog

* Add test cases for legacy vs dynamicFee txs

* Fix typo; Add E2E coverage

* Address PR comments

* Address PR comments

* Use gasFeeCap formula

* Revert "Use gasFeeCap formula"

This reverts commit 2260925.

* Address PR comments

* Fix e2e upgrade tests

* fix: adjust evm outbound tracker reporter to avoid submitting invalid hashes (#2628)

* refactor and fix evm outbound tracker reporter to avoid invalid hashes; print log when outbound tracker is full of invalid hashes

* add changelog entry

* used predefined log fields

* remove repeated fields information from log message; Devops team would configure Datadog to show the fields

* remove redundant fields in log message; unified logs

* remove pending transaction map from observer; the outbound tracker reporter will no longer report pending hash

* use bg.Work() to launch outbound tracker reporter goroutines

* bring the checking EnsureNoTrackers() back

* add more rationale to EVM outbound tracker submission

* sync observer and signers without wait on startup

* try fixing tss migration E2E failure by increase timeout

* feat: Solana relayer (fee payer) key importer, encryption and decryption (#2673)

* configure observer relayer key for Solana; remove hardcoded solana test key from zetaclient code

* implementation of relayer key importer, encryption and decryption

* integrate relayer key into E2E and Solana signer

* add relayer_key_balance metrics and unit tests

* use TrimSpace to trim password

* add changelog entry

* use relayer account array in E2E config; a few renaming; add private key validation when importing

* fix linter

* remove GetNetworkName method for simplification

* added PromptPassword method to prompt single password

* use network name as map index to store relayer key passwords

* moved relayer passwords to chain registry

* airdrop SOL token only if solana local node is available

---------

Co-authored-by: Lucas Bertrand <[email protected]>

* ci: Set Docker Workflow to use Go 1.22 (#2722)

* Set go 1.22.2

* Set go 1.22.2

* Set go 1.22

* Set go 1.22

* Refactor contrib/rpc and contrib/docker-scripts to use snapshots API (#2724)

Co-authored-by: Julian Rubino <[email protected]>

---------

Co-authored-by: dev-bitSmiley <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
Co-authored-by: Charlie Chen <[email protected]>
Co-authored-by: Lucas Bertrand <[email protected]>
Co-authored-by: Charlie <[email protected]>
Co-authored-by: Julian Rubino <[email protected]>
Co-authored-by: Julian Rubino <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants