Comments (3)
ingest
dag/blocks
isChainBlock
is alwaystrue
here
This shouldn't be the case. If it is, then there might be a bug. isChainBlock=true means that the block is part of the selected parent chain, which should not be true for every new block; it should be true only for new blocks that are part of the selected parent chain.
ingest
dag/selected-parent-chain
for each addedChainBlocks set:
block[hash].isChainBlock = true
I would first handle removedBlockHashes, and remove them from the selected parent chain; and only then add the addedChainBlocks to the selected parent chain.
* `acceptedBlockHashes` is not used
When handling each block in addedChainBlocks, what you should do is alter each block in addedChainBlock.acceptedBlockHashes
such that block.acceptingBlock = addedChainBlock
for each removedBlockHashes
block[hash].isChainBlock = false
Also here, for each block in removedBlockHashes, you should clear the property acceptingBlockHash of each block that references a block in removedBlockHashes.
Unfortunately, over time this corrupts the state:
Yes, I am guessing the corruption might occurs because you add before removing.
To conclude, your modus operandi of handling the dag/selected-parent-chain updates should be as follows:
Handling removed blocks from the selected parent chain:
for each block R in removedBlockHashes:
R.isChainBlock=false
for each block B having B.acceptingBlockHash = R.hash:
B.acceptingBlockHash=null.
Handling added blocks to the selected parent chain:
for each block A in addedBlockHashes:
A.isChainBlock=true
for each block B in A.acceptedBlockHashes:
B.acceptingBlockHash=A.hash.
I added all this to the documentation, which you are slowly helping build with your comments =)
https://docs.kas.pa/kaspa/try-kaspa/kasparov-api-server/api/mqtt-topics#block-explorers
Let me know if you have questions.
from dagviz.
The issue I had appears to be on my end due to an operation order mistake:
I was processing ADD updates and then REMOVE, however as explained by the team, the REMOVE should be always done first as the same blocks that are removed can be present in the additions.
This has been addressed last release and is online as of Sunday.
from dagviz.
Two sets of chain blocks appear parallel to each other. As seen in the screenshot, a block points to two parents that are both marked as chain blocks. It means these are not two separate data sets. Since each block, can only have one parent that is a chain block (because a block cannot point to two blocks that are related), I think there is a bug of not correctly updating the property isChainBlock.
from dagviz.
Related Issues (20)
- Hovering all blocks and chain blocks - colors of links to related blocks HOT 1
- No color for anticone of selected tip HOT 2
- Update Accepting Block terminology to Merging Block HOT 1
- Add links to docs.kas.pa specific pages from the DAGviz explorer interface HOT 1
- Add link to Discord HOT 3
- Top Bar UI glitches HOT 1
- Confirmations progress proposal HOT 1
- Colorless block - to be grey - works on light and dark mode HOT 1
- Hover arrow stroke from SPC to SPC is narrower than to non-SPC HOT 1
- Red block mini cards have confirmations
- Block page > Header area > Related blocks HOT 1
- Copy button near block hash, tx hash, tx id and address, on hover
- Objective blocks per second calculation
- Transaction's Including Blocks
- Add Amount and Fee to Block's Transactions Table
- Inputs, outputs to link to other transactions
- Searching for a hash in the omni search box
- Panning UX
- Cannot drag blue score navigator on mobile
- Mobile Explorer interface fixes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dagviz.