-
Notifications
You must be signed in to change notification settings - Fork 123
Bug in micro-fork handling #670
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
Comments
1 task
1 task
zone117x
added a commit
that referenced
this issue
Jul 30, 2021
zone117x
added a commit
that referenced
this issue
Aug 2, 2021
zone117x
added a commit
that referenced
this issue
Aug 6, 2021
Closed by #686 |
wileyj
added a commit
that referenced
this issue
Aug 10, 2021
* origin/develop: (96 commits) chore: update stacks-blockchain docker image to `2.0.11.2.0` feat(rosetta): support stacking, delegate stacking and revoke stacking event fix: bugged re-org logic introduced in microblock implementation #670 feat(rosetta): support passing btc address for rosetta stacking op #672 feat: singular tx with STX transfer events endpoint #622 fix(rosetta): contract details in payload stacking transactions fix: preprocess bug to remove network from the dummy transaction fix: remove token_transfer_recipient_address from stacking transactions feat: add get block by burn block height and by burn block hash (#675) feat: new database connection options fix: bundling issues chore: fix json schema doc example type chore: update openapi/json-schema summaries and examples with latest microblock related changes chore: progress on fixing unit tests chore: stacks-node docker image bumps to 2.0.11.2.0-rc1-stretch feat: add parent_burn_block_{time,hash,height} to txs and microblock API responses chore: fix tests fix: include contract-call metadata in mempool/pending transactions feat: add explicit `is_unanchored: boolean` flag to tx responses chore: remove debug code ...
blockstack-devops
pushed a commit
that referenced
this issue
Aug 11, 2021
# [0.63.0](v0.62.3...v0.63.0) (2021-08-11) ### Bug Fixes * bugged re-org logic introduced in microblock implementation [#670](#670) ([7dfc5a9](7dfc5a9)) * **rosetta:** contract details in payload stacking transactions ([a903cb0](a903cb0)) * all unit and integration tests working with microblock-capable stacks-node ([bf89f6a](bf89f6a)) * bns queries not using the pg query function ([51c762f](51c762f)) * bundling issues ([ab45a15](ab45a15)) * duplicated mempool-tx and mined-tx schemas leading to buggy tx parsing code ([a85dcad](a85dcad)) * fixed invalid URL crash, added route for invalid requests ([81e5bec](81e5bec)) * handling for receiving stale microblock events from stacks-node ([b82b3e0](b82b3e0)) * ignore 'data system is starting' error while connecting to postgres ([f637e8a](f637e8a)) * include contract-call metadata in mempool/pending transactions ([8f36f85](8f36f85)) * issue with client doc generation in gh actions ([3a017f9](3a017f9)) * missing sponsor_address property in some tx responses ([cbe16dd](cbe16dd)) * preprocess bug to remove network from the dummy transaction ([95cd1be](95cd1be)) * preserve logical transaction ordering using INT32_MAX value rather than -1 for batched tx microblock_sequence ([654669c](654669c)) * prevent querying duplicate tx data when existing in both micro-orphaned and unanchored-microblock form ([4903148](4903148)) * remove token_transfer_recipient_address from stacking transactions ([fc95319](fc95319)) * repair bns integration tests ([c0e0a69](c0e0a69)) * repair syntax in sample clarity contracts for debug endpoints ([e576361](e576361)) * various bugs and typing issues with parsing mined and mempool tx db data ([97bb2cb](97bb2cb)) * wip- add try catch and log ([fcb1216](fcb1216)) ### Features * **rosetta:** support passing btc address for rosetta stacking op [#672](#672) ([cf36b8f](cf36b8f)) * **rosetta:** support stacking, delegate stacking and revoke stacking event ([f5190c5](f5190c5)) * add anchored microblock hash array to API anchor block response ([f6a307a](f6a307a)) * add explicit `is_unanchored: boolean` flag to tx responses ([267a5eb](267a5eb)) * add get block by burn block height and by burn block hash ([#675](#675)) ([d002dad](d002dad)) * add microblock metadata to tx byproduct tables ([a3a9605](a3a9605)) * add nonce gap detection and recommended nonce value to /address/{principal}/nonces ([119615e](119615e)) * add parent_burn_block_{time,hash,height} to txs and microblock API responses ([977db77](977db77)) * added microblock metadata to regular/anchor block API responses ([39a8d32](39a8d32)) * allow dangerous `--force` option to drop tables during event-import when migrations had breaking changes ([7f71f2d](7f71f2d)) * anticipated sql schema required for storing microblock data with the ability to handle micro-fork reorgs ([5457a9e](5457a9e)) * API endpoint to return unanchored txs ([6f3aed9](6f3aed9)) * ensure microblock data is marked with the correct anchor-canonical status on receipt of anchor block ([dc89c98](dc89c98)) * env var to enable streaming events to file as they are received ([6114ae0](6114ae0)) * exclude micro-orphaned data from applicable sql queries ([9cff795](9cff795)) * flag microblock tx data as non-canonical when orphaned by an anchor block ([0f2a3ec](0f2a3ec)) * handle microblocks reorgs for micro-forks off the same same unanchored chain tip, e.g. a leader orphaning it's own unconfirmed microblocks ([ecb2c79](ecb2c79)) * handling for the happy-path of microblock-txs accepted in the next anchor block ([8ce3366](8ce3366)) * implement endpoint to get the latest account nonce based off mempool and unanchored or anchored tx data ([0b33bcb](0b33bcb)) * logical ordering of txs and events (e.g. for pagination) using microblock_sequence with tx_index ([0593591](0593591)) * microblocks API endpoints ([19e92ae](19e92ae)) * new database connection options ([d3f23d3](d3f23d3)) * option to "replay" event emitter data via program args ([e0d5c5f](e0d5c5f)) * option to export all raw event observer requests to file via program args, progress on replaying requests through the observer interface ([912113d](912113d)) * parse txs from microblock event payloads and inserted into db ([dc32f4e](dc32f4e)) * populate tx metadata tables (stx transfers, contract deployments, etc) with index_block_hash on microblock acceptance ([e8689b1](e8689b1)) * progress on making unanchored microblock tx data opt-in in API requests and db sql queries ([3057ab3](3057ab3)) * prune txs from mempool on microblock-tx receipt ([36158ba](36158ba)) * refactoring microblock data oprhaning logic into separate functions for usage in streamed micro-fork handling ([60fcd0a](60fcd0a)) * singular tx with STX transfer events endpoint [#622](#622) ([6dbbba6](6dbbba6)) * store raw event observer request payloads in db ([33fe79e](33fe79e)) * storing microblock headers, progress towards storing microblock txs ([6fa003c](6fa003c)) * storing microblock tx events and other metadata ([1871446](1871446)) * support microblock canonical status updating during anchor block re-orgs ([09844c2](09844c2)) * support processing of confirmed-only microblock data, see stacks-network/stacks-core#2668 ([d4b72e8](d4b72e8)) * **debug:** ability to broadcast test txs using unconfirmed chain tip nonce ([ab672f8](ab672f8))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Transaction
0xc03f1204350a2ef9b367252ef92aa46a95091b946b7622185b09d1b3cfa5097e
appears to have been part of a re-org involving an orphaned microblock, and ended up without any canonical tx rows in the db.https://stacks-node-api-microblocks.testnet.stacks.co/extended/v1/tx/0xc03f1204350a2ef9b367252ef92aa46a95091b946b7622185b09d1b3cfa5097e
The pending tx data is being pulled from the
mempool
db. The actual status of the transaction in the db for the 2 transaction rows are markedcanonical=false
for both forks. Also, the tx's canonical anchor block appears to have confirmed a microblock stream, but does not list any microblocks in themicroblocks_accepted
response.https://stacks-node-api-microblocks.testnet.stacks.co/extended/v1/block/0x70b1ce7c8ac98bbc6bbe2c40688ce22c2047d56764ddb34f1fa611adc6c4ff34
The orphaned anchor block https://stacks-node-api-microblocks.testnet.stacks.co/extended/v1/block/0x688e370f23b1b7b99f700ffab2800c68f81f3e05fd99b2be1a5866a9a41d9e64
The orphaned microblock is marked
canonical=true
butmicroblock_canonical=false
.https://stacks-node-api-microblocks.testnet.stacks.co/extended/v1/microblock/0xa272fe0501b770e6dc4c1af8de1059982db7621ff6491f5ae361a7aedbc63dd1
This seems like a bug in the orphan restoration logic, because the canonical block appears to have been seen first, likely marked orphaned temporarily by another block before winning out and being restored.

I'm still investigating the event replay logs to narrow down the scenario, then hopefully re-create in a test and fix.
The text was updated successfully, but these errors were encountered: