finschia / finschia-sdk Goto Github PK
View Code? Open in Web Editor NEWA framework for building blockchains based Finschia Mainnet that is forked from cosmos-sdk
License: Apache License 2.0
A framework for building blockchains based Finschia Mainnet that is forked from cosmos-sdk
License: Apache License 2.0
The MaxGas
(not a cosmos gas, but for a wasmer gas) should not be changeable but be coupled with the backend's max value.
It is an underflow prevention logic for setting an actual gas-limit.
https://github.com/line/cosmwasm/blob/develop/packages/vm/src/backends/singlepass.rs#L51
Related with: https://github.com/line/lbm/issues/1135
signature verification cache
Now, ISSUE/PR Templates are the same as cosmos-sdk and they contain some links referring cosmos's repository.
We should rewrite them for our repositories.
Rewrite ISSUE/PR Templates before this repository will be published.
I propose using sig_block_height
and sequence to sign a tx instead of account number
and sequence.
The account number and sequence are currently used for transaction signing.
However, in order to send tx, the account must be created in the chain in advance due to the account number.
Although the rule above is not a big problem in public blockchains because users must receive coin before sending tx, CBDC is expected to have several types of tx that can occur in various accounts other than send tx.
So we have a requirement that we are able to create an account before receiving a coin.
We can also define a message called account_create
as in previous chain, but we believe that broadcasting tx to create an account can put a heavy load on the chain, requiring a way to sign tx before it is created.
To this end, I thought about using a certain block height as signing data rather than account number.
It is mentioned here that Cosmos developers have previously discussed this: cosmos/cosmos-sdk#455 (comment)
The block height has the advantage of being able to sign tx for the first time even if the account is not in the chain. We also need this information because we need to consider the functionality of account deletion, and if the block height is within the valid range(I wish we call it VALID_SIG_BLOCK_PERIOD
; configurable), it will pass the sign verification.
There is no reason why the sig block height of tx having sequence n should be smaller than the sig block height of tx having sequence n+a. Any sig block height
that are greater than (the current block height - VALID_SIG_BLOCK_PERIOD
) is valid. Instead, when removing an account, it will be necessary to make sure that he has signed within this period.
Using sig block height to sign tx instead of account number.
Related with: https://github.com/line/lbm/issues/1121, https://github.com/line/lbm/issues/1139
implement blocks_with_tx_results
via grpc
I think these are not enough describing when they are costed.
Rewrite gov, ibc and readme docs for wasm.
They are removed by PR #260
This always issues an error because the message lacks Label
.
related with: CosmWasm/wasmd@6acc712
v1/develop
There is no version in a message. If some message processing is changed and this results in the different app hash, then we face the difficulty of upgrading the chain in that case.
It would be nice to have a version of the message processing module to solve this. The processing module of a particular message allows a particular version to operate after a particular block height.
For line/link#729, we need to integrate jaeger with cosmos-sdk
Seem that we should define another
EventType
to specify msg action details.It seems that
x/wasm
is using events incorrectly as a whole.The original concept seems that
EventTypeMessage
specifies only module and sender and the details of action will be included in anotherEventType
Let's correct it another issue.
Originally posted by @whylee259 in #122 (comment)
sig_block_height
should be included in tx_body by #265.
But by definition, it would be more appropriate to enter the sign doc
.
We need to think about this.
x/wasm/linkwasmd is a d/client app and was used for the integration tests. But it is now outdated and will be deleted.
Ticker for LINK(the LINE token) is LN, not LINK. So we may need to support a ticker with 2 letters.
Originally posted by @beneficial02 in https://github.com/line/link/pull/233
The current query responses are in the internal
path.
So the outside of wasm
module cannot refer to the response data structures such as cli_test.
open wasm query responses to public
Replacing package name does not apply to the final referrer, so the final referrer (e.g. lbm) must copy the replace
of all referencing packages.
This can lead to unintended version conflicts.
It would be better the use our own package name for the forked repo rather than use replace
.
Change the wasmvm package name.
github.com/CosmWasm/wasmvm
โ github.com/line/wasmvm
Assess risk of updating denom specification for LRC-17 update request.
Related with: https://github.com/line/link/issues/1136
fix: not to increase sequence if the tx is not valid.
We need the contract-banning features for the contract. Banned contracts should not be able to execute/migrate/update-admin/clear-admin.
This is an issue derived from a survey on the 90-character limit of bech32.
GetPubKeyFromBech32 () at address.go in cosmos-sdk
The public key structure is obtained from the public key encoded in bech32. If we don't use bech32 encoding in this process, the speed will improve.
valPubKey: {PubKeyBLS12{9095AA25A97443CFBD4B560218BD03E0A134C93FC741049DF4D9D2E807560B5345EEDCEB0B981315BEEB5A04C735F8F7} PubKeyEd25519{FC5C2EC94D5A11511C2E8134AB6A8D397CC5B2FBC8DFAE6E5A1F6E639091F84A}}
unit:nanosecond
method | encode average time | decode average time | encode size |
---|---|---|---|
bech32 | 6407 | 5572 | 178 |
base32 | 2162 | 1099 | 160 |
base64 | 2236 | 442 | 132 |
unit:bytes
method | encode size | encoded data |
---|---|---|
bech32 | 178 | linkvalconspub1qxyxudq2xhtgl77pxzgft239496y8naafdtqyx9aq0s2zdxf8lr5zpya7nva96q82c94x30wmn4shxqnzklwkksycu6l3acjy5tzfhnyyr79ctkff4dpz5gu96qnf2m235uhe3djl0ydltnwtg0kucusj8uy53d43ud |
base32 | 160 | AGEG4NAKGXLI766BGCIJLKRFVF2EHT55JNLAEGF5APQKCNGJH7DUCBE56TM5F2AHKYFVGRPO3TVQXGATCW7OWWQEY427R5YSEULCJXTEED6FYLWJJVNBCUI4F2ATJK3KRU4XZRNS7PEN7LTOLIPW4Y4QSH4EU=== |
base64 | 132 | AYhuNAo11o/7wTCQlaolqXRDz71LVgIYvQPgoTTJP8dBBJ302dLoB1YLU0Xu3OsLmBMVvutaBMc1+PcSJRYk3mQg/FwuyU1aEVEcLoE0q2qNOXzFsvvI365uWh9uY5CR+Eo= |
valPubKeyString:
linkvalconspub1qxyxudq2xhtgl77pxzgft239496y8naafdtqyx9aq0s2zdxf8lr5zpya7nva96q82c94x30wmn4shxqnzklwkksycu6l3acjy5tzfhnyyr79ctkff4dpz5gu96qnf2m235uhe3djl0ydltnwtg0kucusj8uy53d43ud
valPubKey: PubKeyEd25519{59DDF1994FC24AF8240B79FBF310E119C998FDB177AAACE36D382DB74A28912A}
unit:nanosecond
method | encode average time | decode average time |
---|---|---|
bech32 | 2844 | 4213 |
base32 | 560 | 768 |
base64 | 541 | 188 |
unit:bytes
method | encode size | encoded data |
---|---|---|
bech32 | 81 | linkvalconspub1zcjduepqt8wlrx20cf90sfqt08alxy8pr8ye3ld3w742ecmd8qkmwj3gjy4qnfh7pd |
base32 | 64 | CYSN4ZBALHO7DGKPYJFPQJALPH57GEHBDHEZR7NRO6VKZY3NHAW3OSRISEVA==== |
base64 | 52 | FiTeZCBZ3fGZT8JK+CQLefvzEOEZyZj9sXeqrONtOC23SiiRKg== |
valPubKeyString:
linkvalconspub1zcjduepqt8wlrx20cf90sfqt08alxy8pr8ye3ld3w742ecmd8qkmwj3gjy4qnfh7pd
Ref:
#47
There is still FIXME same as CosmWasm/wasmd#282 .
There are many broken links in https://github.com/line/lfb-sdk/blob/develop/x/ibc/spec/README.md
and
Waits for block confirm with only simple sleep.
It should be checked with block height info and retry if height is not changed. And this change enables to shorten the sleeping time.
Let's think of an update that adds a new module to a chain in running. We will stop a node and restart the node with the new module added. The new node will mount the added module's store, and even if the store does not have data, it will reflect the added store when calculating the app hash. This results in creating an app hash that is different from the nodes that have not yet been upgraded. This is one of the factors that makes updating difficult.
To solve this problem, when calculating an app hash, one can consider whether a new module's store is included after a specific block height.
an considerable example implementation
func (ci CommitInfo) toMap() map[string][]byte {
m := make(map[string][]byte, len(ci.StoreInfos))
for _, storeInfo := range ci.StoreInfos {
if storeInfo.IsActive(height) { // the new added module will be activated after some height
continue
}
m[storeInfo.Name] = storeInfo.GetHash()
}
return m
}
func (ci CommitInfo) Hash() []byte {
if len(ci.StoreInfos) == 0 {
return nil
}
rootHash, _, _ := sdkmaps.ProofsFromMap(ci.toMap())
return rootHash
}
Move wasm proto files to proto folder like other modules do.
CHANGELOG of wasm module are separated in https://github.com/line/lfb-sdk/blob/main/CHANGELOG.md and https://github.com/line/lfb-sdk/blob/main/x/wasm/CHANGELOG.md. These should be merged.
Comment in x/wasm/alias.go says that this code is generated by github.com/rigelrozanski/multitool. But now, this is different from what this tool generates.
Try to use this tool and decide whether we use it.
As various gov params were taken from paramSpace, the cost of storage gas increased.
It's not a bug, but I found out that there was a cost increase more than I expected while fixing the test case.
There is additional gas consumption as paramSpace getters such as k.getGasMultiplier(...) are called more than 4 times in various APIs such as Inistnatiate, Execute, etc. And these consume 1015 per time.
So, totally more consumed additionally over than 4k when every API called.
https://github.com/line/lbm-sdk/blob/95eb4e7aef273977d89585676da5309c83dad887/go.mod#L19
gogo/protobuf v1.3.3 does not exist.
and the replace
https://github.com/line/lbm-sdk/blob/95eb4e7aef273977d89585676da5309c83dad887/go.mod#L62
does not work in make build
in x/wasm/linkwasmd.
Because of them, make build
in x/wasm/linkwasmd fails.
v2/develop
(95eb4e7)
The public key generated by BLS12-381 is 96 characters. Encoding / decoding format bech32 cannot be decoded because the maximum decoding is less than 90 characters.
With the BLS signature method, a public key is distributed to verify the aggregated signature. Since it will be an aggregated signature (a collection of several signature information), the length of the public key used for the verification is will be about 1.5 times longer than that of ed25519, and a longer public key will be created. (Generated by BLS12-381 curve)
The encoding method for creating an address from a public key is bech32, which compensates for some of the drawbacks of base58 which is based on base64.
Roughly
This has been improved and the encoding code method is bech32.
Currently, bech32 is used, but when decoding the validator address, there is a limit of "90 bytes", and pubkey (96 bytes) (165 bytes including vrf), which is larger than this limit, is input. Decoding has failed.
#!/usr/bin/env bash
set -ex
# initialize
rm -rf ~/.linkd ~/.linkcli
# Configure your CLI to eliminate need for chain-id flag
linkcli config chain-id link
linkcli config output json
linkcli config indent true
linkcli config trust-node true
linkcli config keyring-backend test
# Initialize configuration files and genesis file
# moniker is the name of your node
linkd init solo --chain-id link --priv_key_type composite
linkcli keys add jack
linkcli keys add alice
linkcli keys add bob
linkcli keys add rinah
linkcli keys add sam
linkcli keys add evelyn
# Add both accounts, with coins to the genesis file
linkd add-genesis-account $(linkcli keys show jack -a) 1000link,100000000stake
linkd add-genesis-account $(linkcli keys show alice -a) 1000link,100000000stake
linkd add-genesis-account $(linkcli keys show bob -a) 1000link,100000000stake
linkd add-genesis-account $(linkcli keys show rinah -a) 1000link,100000000stake
linkd add-genesis-account $(linkcli keys show sam -a) 1000link,100000000stake
linkd add-genesis-account $(linkcli keys show evelyn -a) 1000link,100000000stake
linkd --keyring-backend=test gentx --name jack --priv_key_type composite
# flag add?? TODO
# linkd --keyring-backend=test -- gentx --name jack
# linkd add-genesis-account $(linkcli keys show jack -a) 1000link,100000000stake
# linkd --keyring-backend=test --priv_key_type composite gentx --name jack
# linkd gentx --keyring-backend test --name jack --priv_key_type composite
linkd collect-gentxs --priv_key_type composite
linkd validate-genesis
ERROR: failed to build create-validator message: decoding bech32 failed: invalid bech32 string length 165
When we make build linkwasmd, we get error due to different arguments.
# github.com/line/lbm-sdk/v2/x/wasm/linkwasmd/cmd/linkwasmd/cmd
cmd/linkwasmd/cmd/root.go:162:45: not enough arguments in call to store.NewCommitKVStoreCacheManager
have ()
want (int, cache.MetricsProvider)
https://github.com/line/lbm-sdk/blob/v2/develop/x/wasm/linkwasmd/cmd/linkwasmd/cmd/root.go#L162
A 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.