forked from ordinals/ord
-
Notifications
You must be signed in to change notification settings - Fork 29
feat: Add support for BRC2.0 operations: InscribeWithdraw, Withdraw, InscribeProgDeploy, InscribeProgCall, InscribeProgTransact, ProgDeploy, ProgCall, and ProgTransact #62
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
Open
alpergundogdu
wants to merge
49
commits into
okx:dev
Choose a base branch
from
alpergundogdu:brc20-prog-module
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added support for BRC20 predeploy operations, including new data structures and serialization logic. - Introduced `BRC20Predeploy` struct to store predeploy information such as hash, predeployer address, and block height. - Updated `BRC20Operation` enum to include `Predeploy` variant. - Enhanced `TableContext` to manage predeploy records in the database. - Implemented validation logic for predeploy operations, ensuring correct hash and age checks. - Updated ticker validation to support 6-byte tickers for predeploys. - Added tests for predeploy serialization, validation, and integration with existing BRC20 operations. - Modified API event structures to include predeploy events for external communication.
…InscribeProgDeploy, InscribeProgCall, InscribeProgTransact, ProgDeploy, ProgCall, and ProgTransact - Documented BRC2.0 indexing params in README.brc20.md - Extended ApiTxEvent enum to include new event types. - Implemented conversion from BRC20Receipt to ApiTxEvent for new events. - Created new event structures for InscribeWithdraw, Withdraw, InscribeProgDeploy, InscribeProgCall, InscribeProgTransact, ProgDeploy, ProgCall, and ProgTransact. - Implemented execution logic for InscribeProgCall, InscribeProgDeploy, InscribeProgTransact, and Withdraw operations. - Added serialization and deserialization for new operation types. - Enhanced error handling and validation for new operations. - Developed BRC20BlockEventHash to handle event receipt and hash generation. It validates against OPI if the --opi-validation is set, and panics if there's any mismatch if --opi-validation-strict is set. - Fixed PR !61 by counting erroneous self_mint values as "false" instead
- Add customization of OPI_API_URL via env for debugging
- Refactor OkxUpdater with Brc20IndexingConfig - Add BRC20 prog reorg handling in reorg module - Rename ToEvmHash to ToB256ED - Improve code organization in BRC20 executors
… data cases to inscribe event
…and adjust amount calculation based on decimals
…il the check if OPI doesn't have an event hash stored (not yet indexed)
… if it's a non-strict check Context: This happened during mainnet testing and there were no hashes for previous blocks in the database, hence breaking the checks (to avoid re-indexing, this can be cleaned up afterwards). It also allows non-strict checks, if one block has a wrong hash, we don't halt completely, and continue from the next block
…ures and related functions (to record invalid hashes as events)
… compare the hash to OPI (even if it's missing)
…sh in strict mode
- in strict mode, we never reach here - in relaxed mode, it logs an error and returns Ok(..) as intended
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documented BRC2.0 indexing params in README.brc20.md
Extended ApiTxEvent enum to include new event types.
Implemented conversion from BRC20Receipt to ApiTxEvent for new events.
Created new event structures for InscribeWithdraw, Withdraw, InscribeProgDeploy, InscribeProgCall, InscribeProgTransact, ProgDeploy, ProgCall, and ProgTransact.
Implemented execution logic for InscribeProgCall, InscribeProgDeploy, InscribeProgTransact, and Withdraw operations.
Added serialization and deserialization for new operation types.
Enhanced error handling and validation for new operations.
Developed BRC20BlockEventHash to handle event receipt and hash generation. It validates against OPI if the --opi-validation is set, and panics if there's any mismatch if --opi-validation-strict is set.
Fixed PR !61 by counting erroneous self_mint values as "false" instead