bandprotocol / bandchain Goto Github PK
View Code? Open in Web Editor NEWBandChain - Decentralized Data Delivery Network
Home Page: https://bandprotocol.com
License: Apache License 2.0
BandChain - Decentralized Data Delivery Network
Home Page: https://bandprotocol.com
License: Apache License 2.0
Currently a compiled Wasm code needs to be sent with a data request transaction, causing a transaction to be huge. This is silly if the same source code is sending over and over. This epic is about creating messages and handlers to add code storage functionality.
The messages allow user to store and delete code from the blockchain long term storage. The code can be referred later with code hash.
zoracle
moduleInstead of hardcoding the whole config.toml
for seed/persistent peers. We can pass them directly as the command line arguments when running bandd start
. That way, we have one less (quite big) file to maintain!
What to do before start
We decided to go with the module name from oracle
to zoracle
to simplify the steps required to perform multistore proof checking. Now that we did this, let's change every occurrence of oracle
name to zoracle
to avoid confusion down the line.
To prevent potential exploit directly to the host, all commands should be run inside of a one-time-purpose docker instance. This also helps with having one consistent docker runtime for all data providers to support similar programs with similar versions / environments.
Setup CI to run tests for every push that affects bridge/evm
directory.
What to do
Let's make the prefix 0xff
following by Request ID, CodeHash, and Parameters.
v
is missing ๐จ.
Deliverables:
Potential Solutions
v
s on-chainv
off-chainSome pointers:
It has left as TODO in code chain/x/zoracle/handler.go
And only allow valid app hashes that have been signed by enough validators to be stored on the contract.
It was hardcoded just to allow test to run. Update the unit tests and remove the TODO line.
Code storage keeper and handler allows the blockchain to process code storage messages. D3N should handle MsgStoreCode
by keeping the code in a long term storage, using code hash as lookup key. MsgDeleteCode
should remove the code from the storage. As simple as that!
Introduce the inflation of BANDs. Adding minting features that will inflate BANDs to blockchain validators for every block produced, using the same parameters as the Cosmos chain.
Make it compatible with #78. It uses codeHash
instead of code
We updated the way an array can be encoded by using just one 64 bit integer (top 32 encoding the size, and bottom 32 encoding the location of data). Let's update owasm
code base to work like that.
Currently the coin address is stake
. We want to change it to BAND
to celebrate the existence of Band token on its own sovereign chain.
Research and build a POC version of Owasm runtime that terminate upon reaching certain gas limit. It is still pretty much open ended, but this should be a good starting place: https://github.com/wasmerio/wasmer/blob/master/lib/middleware-common/src/metering.rs.
Deliverables:
D3N chain code uses docker for deployment. It would be good if a docker image for running D3N node is building automatically for every code update.
prefixes
is rather confusing, and is not even prefix. It's actually the combination of whether a proof is going on the left or right direction and a variable length data for a merkle internal node that is not relevant to Merkle proof (such as subtree version / subtree size / etc). Additionally, it's a uint256[]
even though it has nothing to do with integers!
So, let's remove prefixes
and introduce two new things:
uint256 mask
: This is a uint256
bitmask that encoded Merkle proof direction, kinda similar to Sparse Merkle Treebytes[] extraInternalNodeData
: Using, ABIEncoderV2, we can just directly accept bytes array. If it proves to be inefficient, we can always go back to the old approach, but I doubt it.Also let's merge UintLib with BytesLib since it only has function that is pretty much related to bytes.
Currently the address prefix is cosmos
. We should change it to band
.
band
, including prefix of user address, validator address, etcThe value actually consists of multiple things, including code hash, valid block number, actual data value, etc. Let's make smart contract on Ethereum able to parse the information.
Currently it re-defines some data types that should just have been imported from Tendermint. Let's do that to reduce the amount of code we need to maintain. Note that this means we need to use the same mechanism to encode/decode data to JSON (most likely involved amino/codec).
In that case, the task should just return whatever was already printed to stdout.
We all know it supports getting proof, checking status, etc. But what exactly is the spec?
Event subscriber from tendermint stop subscribe after listen 4 reports in one block
How to produce?
Run chain with 4 validators when request has been executed. All 4 validators send report to chain in the same block, but tendermint server cannot handle report event correctly. (Internal buffer is full with capacity = 1)
Possible root cause
After experiment error come from https://github.com/tendermint/tendermint/blob/master/libs/pubsub/pubsub.go
in send
function. Code cannot push new event to channel because it's full. Consumer is https://github.com/tendermint/tendermint/blob/master/rpc/core/events.go
that consume data after new event push make pubsub return error and try to cancel subscription.
Way to solve
After code store messages are complete. MsgRequest
should just accept code hash.
MsgRequest
to take code hash instead of full codeMsgRequest
to code from storage and throw error if code does not existA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.