-
Notifications
You must be signed in to change notification settings - Fork 685
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
[Stacks 2.1] Lack of synthetic event attached to Delegate Stacks STX Bitcoin op #3465
Comments
This is also related to #2591 The event data given for Bitcoin-chain stacking ops has never included enough information to generate an accurate TX for regular Stack-STX, but we've never seen anyone complain (lack of usage perhaps?). |
This could be added though. What kind of information do you need? We can already obtain and return anything you'd get from a normal contract-call to stack-stx (or delegate-stx or stx-transfer?), since that's how the system processes it. |
Does the system generate a contract-call transaction object that can be serialized like a regular contract-call? If so, simply serializing it and including it in the event payload should give the API enough (along with the associated pox2 print events that the normal txs have). For reference, the current payloads for these tx types have this null byte property if (coreTx.raw_tx === '0x00') {
const event = allEvents.find(event => event.txid === coreTx.txid);
if (!event) {
logger.warn(`Could not find event for process BTC tx: ${JSON.stringify(coreTx)}`);
return null;
}
if (event.type === CoreNodeEventType.StxTransferEvent) {
rawTx = createTransactionFromCoreBtcTxEvent(chainId, event, coreTx.txid);
txSender = event.stx_transfer_event.sender;
} else if (event.type === CoreNodeEventType.StxLockEvent) {
rawTx = createTransactionFromCoreBtcStxLockEvent(
chainId,
event,
blockData.burn_block_height,
coreTx.raw_result,
coreTx.txid
);
txSender = event.stx_lock_event.locked_address;
} else {
logError(
`BTC transaction found, but no STX transfer event available to recreate transaction. TX: ${JSON.stringify(
coreTx
)}`
);
throw new Error('Unable to generate transaction from BTC tx');
}
} |
Only delegate-stx is a Bitcoin op, not delegate stacks stx. Isn't it? Is there a synthetic event for delegating STX? |
Where are the available btc ops defined? I can only find this in SIP-007 (i.e. |
Yep. The problem is that because these Bitcoin ops are sent to the event-observer with
The DelegateStx Bitcoin op was introduced in 2.1, details here: https://github.com/stacksgov/sips/blob/a7f2e58ec90c12ee1296145562eec75029b89c48/sips/sip-015/sip-015-network-upgrade.md#new-burnchain-transaction-delegate-stx |
Would an adequate solution to this be to add information that allows transactions to be classified more easily? I did something like that in this PR: hirosystems/stacks-subnets#168, and could do that here as well. |
Personally in favor of adding a new event type (emitted by both native + bitcoin), as I don't see a verbose system being an issue (specially when it comes to STX tokens status) but I'll let @zone117x chime in, as adding new event types to the system could be an issue for the API. |
As a pool admin, I very much like the idea of a new event type or print event that works with stx and btc. |
I think it makes sense to just add another synthetic pox-2 contract print event for the At this point I think it makes sense to scope this issue to only the |
Addressed in #3503 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It looks like the stacks-node is not attaching a synthetic event when crafting synthetic transactions created for representing Bitcoin operations performing a delegate Stacks STX.
This synthetic events are essentials for downstream event observers: transactions can't be classified without these, a typical stacks-api node would block its observed stacks-node, resulting in frozen stacks explorers, etc.
cc @zone117x for confirmation.
The text was updated successfully, but these errors were encountered: