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

🐛 Fix payments recognition during advances #180

Merged
merged 5 commits into from
May 11, 2024
Merged

Conversation

AlexV525
Copy link
Contributor

@AlexV525 AlexV525 commented May 9, 2024

The verified status of an Atomical relies on the reveal window. The height in the query is the latest advanced block height rather than the processing height, which leads to an incorrect verified status for the container and realm.

The issue used to produce incorrect block hashes, probably incorrect Atomicals assets.

See height:tx records below for more details on the testnet:

  • 2532818: b756276cdd06cc188c0266010c9fbf3e416089967a898275ca2909b93081f3ce
  • 2569512: a98015464f0859b5f56011b4c0fb8911a83cac61cd77730744447919c79471a0

@AlexV525 AlexV525 changed the title 🐛 Fix dmpay during advances 🐛 Fix payments recognition during advances May 9, 2024
@AlexV525
Copy link
Contributor Author

AlexV525 commented May 10, 2024

Verified with random start heights reindexing on the testnet.

Before

  • 2532818: 2973a121b4886ec01ad5676e10e00481edf7662fe5027e1e56704b7f31025050
  • 2569512: 45a26b5c0370167df19e0dabb6e57c1e4b631d9812d82832b8c05158447b1942

Expected:

  • 2532818: 918917675000438163934ef4dc882e0883c3fdc2dca3346c178f83e6c7e2ecd2
  • 2569512: dfc1367fc7445a2feb9a39e875cd6f142dabbf27bb63085425bd8a35f738456c

@AlexV525 AlexV525 marked this pull request as ready for review May 10, 2024 01:28
self.logger.info(f'advance_txs: found valid subrealm payment create_or_delete_subname_payment_output_if_valid {hash_to_hex_str(tx_hash)}')
append_hashX(double_sha256(payment_tx_hash))
append_hashX(double_sha256(subrealm_payment_tx_hash))
self.put_op_data(tx_num, tx_hash, "payment-subrealm")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it necessary to write the corresponding operation based on the successful payment status of payment? Like payment-subrealm and payment-subrealm-failed

@AlexV525
Copy link
Contributor Author

AlexV525 commented May 10, 2024

Per offline discussion, op record should indicate if the payment is failed, for example, payment-dmitem-failed instead of payment-dmitem. There will be a follow-up PR to address it.

@@ -2209,7 +2208,8 @@ def get_raw_mint_info_by_atomical_id_notused(self, atomical_id):
# Get the atomical details base info
# Does not retrieve the active b'a' locations in this method because there could be many thousands (in the case of FTs)
# Another method is provided to layer on the active location and gives the user control over whether to retrieve them
def get_base_mint_info_by_atomical_id(self, atomical_id):
def get_base_mint_info_by_atomical_id(self, atomical_id, height: int = None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

"None" is incompatible with "int"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with Optional[int].

@AlexV525 AlexV525 merged commit 4e530ac into develop May 11, 2024
2 checks passed
@AlexV525 AlexV525 deleted the fix/advance-dmpay branch May 11, 2024 06:29
Copy link

@Emmyjago Emmyjago left a comment

Choose a reason for hiding this comment

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

Good

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.

3 participants