0Chain Weekly Debrief — September 21, 2022
Happy Wednesday! Last week the dev team finally merged the state hash mismatch PR 1594 into staging. The next step will be merging the batch-update branch and fixing conflicts and any possible issues. Meanwhile, the team closed 12 PRs and 15 related issues in the 0Chain repo.
The team changed the Allocation.Terms from string to []AllocationBlobberTerm and associated it with the AllocationBlobberTerms table. The terms store all the blobbers terms info that are linked to the allocation. Previously, when updating the allocation, the team would encode all the terms into a json string first, and then update to the event database. This was a bad design, as the terms data would already be saved to the database. The previous method made it impossible to ignore the terms update because UpdateAllocation would always try to update the data to its latest version. Now it is not necessary to update the terms every time. Although the team has optimized a lot of places to avoid using UpdateAllocation events, there are still places that cannot be avoided. After changing it to []AllocationBlobberTerm the field will just be ignored by default when not setting the data for updating, and it is not necessary to use json encode/decode anymore. Check for details here.
Furthermore, the team implemented hooks/triggers for updating allocation and blobber challenge stats instead of emitting UpdateAllocation events to update all of the stats data or emit separate events to update the allocation and blobber. Therefore, the hooks will update the challenge for each time when adding a new challenge or updating challenges to the database. Moreover, they added separate events to update allocation staked fields instead of emitting UpdateAllocation to update all allocations. Also, they detected and removed a place that was emitting events on every round to update miners settings by overwriting. This place was wasting resources, while changing nothing to the miner itself.
In addition, they optimized to update stake pool total offers only when it has changed. Previously, the stake pool total offers would be updated every time when interacting with the stake pool. However, the total offers would only change in specific cases, while the stake pool would change every round several times with each interaction. Moreover, they merged allocation blobber terms’ update events. Also, the team merged the allocation stake data update events. Merged this PR and all associated PRs in other repos. Fixed conflicts while merging the latest changes from staging, and fixed several issues while processing the merges.
Fixed swagger error caused by the incompatible gofmt of go 1.19 and the go swagger. The gofmt will rearrange the swagger router comments. Fixed associated system test error in PR. Fixed miner/sharder stake pool pending status, which caused test failure. Implemented the helper function waitStakePoolActive to wait for config.RewardRoundFrequency rounds before staking the pool again. Fixed SAS balance regex error. Removed pool_id params.
Merged associated gosdk to use client id as pool id. Merged associated zboxcli to update gosdk and remove pool id. Merged associated zwalletcli to update gosdk and remove pool id.
Changed mocks from common repo instead of calling script to generate on running the tests on github actions. Implemented allocation cancellation charge. Fixed with check zcnsc signature threshold. Fixed leftover changes required on verifying the zcnsc signatures and threshold. Fixed blank page on diagnostic page for smart contract handlers. Removed the info field from the storage node, which will be stored in the zbox server instead of 0Chain network. Fixed with misc endpoint changes for block rewards system tests. Added field to identify if a block is finalized or not. Closed PR by including operation in writeMaker.
With current merges and fixes, the team expects a decrease in the rate of opening issues, while closing more issues.
Developer Resources
- Interested in learning more about building on 0Chain or becoming a service provider? Check out our GitHub for access to repositories. Community ambassador Sculptex has created numerous tutorials to help get you started.
- Try our BetaNet here! Users can create wallets and allocations, store files, send transactions, and share files.
- Need help navigating creating wallets, allocations, or joining as a blobber? Check out our documentation page.
- 0Chain’s API endpoints use simple and intuitive HTTP requests to interact with the blockchain in order to send/retrieve information to and from miners, sharders or blobbers in the active network.
About 0Chain
0Chain is a high-performance decentralized storage network designed to eliminate business threats such as censorship, privacy liability and data breaches. 0Chain helps entities achieve GDPR compliance, localization and tokenization, and monetizes private data sharing.