Git Product home page Git Product logo

gowaves's People

Contributors

alexeykiselev avatar anton-rampage avatar artemreyt avatar bodrych avatar cryptopragmatic avatar dependabot[bot] avatar esuwu avatar frozen avatar irina-pereiaslavskaia avatar juneezee avatar montekki avatar nickeskov avatar rozhaev avatar zer0main avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gowaves's Issues

[V1.2] Remove DataEntries from Account state

Аbstract
Allow the removal of data entries in account's state.

Specification

The 4th version of DataTransaction supports keys with empty data. If user puts a key without data into DataTransaction this keys should be removed from account's state along with existing data.

  • It is possible to add, update and remove entries in one DataTransaction if keys a different
  • Data associated with removed key should be remove from state
  • Previously removed keys can be used again with new data
  • Removing nonexistent key is no-op
  • User can add up to 100 keys for removal in one DataTransaction

[FEATURE] Add synchronization from NODE REST API on local-node, and fix error at block 1610029 - 1610030

Аbstract

Is your feature request related to a problem? Please describe.

Yes. wmd v0.3.0 cann't synchronize database from NODE REST API on local node,
and need to raise gRPC server there. What if I use old version of the node???
Also, synchronization is stopped at blocks 1610029 - 1610030.
See the details in this issue: #285
So, need to fix it, in the next versions of wmd.exe

Motivation and Purposes

A clear and concise description of what the problem is. Ex. I'm always frustrated when [I cann't downloading candles and trading history for all trading pairs].

** Specification**

A clear and concise description of what you want to happen.
Describe alternatives you've considered

I want to load candles and orders history for all trading pairs, to display this data in waves-lite client.
I want to do this from my local node, not from remote node, which can go offline at any time.
I want to do this up to end block, without see any errors at blocks 1610029 - 1610030.

Backwards Compatibility

Can your proposition affect any existing features?

No. Just fix this WMD.exe.

Examples and Implementation

Examples of implementation in other projects?

https://marketdata.wavesplatform.com this is working fine, but this is remote server.

Node: limit the number of peer connections

Аbstract
Node currently connects to unlimited number of peers.

Motivation and Purposes
Even limited number of connections is enough for node to function securely.

Specification
New config option that specifies the limit of connections should be introduced.

Backwards Compatibility
Backward compatible.

Transpiling of RIDE scripts to native Go code

Аbstract
The interpretation of RIDE scripts is slow. The idea is to transpile scripts those already in blockchain into a native Go functions and use them while importing blockchain or while validation of all scripts known at the moment of release.

Motivation and Purposes
To speedup the import and validation of blocks, to reduce the memory footprint of the node.

Specification

  1. Transpiler
    Implement the transpiler as a command line utility that will extract all scripts that in given blockchain file and generate Go source code for every script.
  2. Node with built-in scripts
    Include the generated functions in separate package in gowaves node. Add the index to lookup for the native function for a script. If there is a native function for a script in blockchain use it to validate transactions, if not use the default interpretation technic.

Backwards Compatibility
In case of impossibility to transpile a script the existing interpretation will be used.

[V1.2][RIDE V4] Implement Sponsorship script action

Specification

Implement RIDE function SponsorFee(assetId: ByteVector, minSponsoredAssetFee: Int|Unit) to produce a Sponsorship action as a result of script invocation. The effect of the action is the same as for Sponsorship transaction.

Parameter Type Description
assetId ByteVector ID of an asset
minSponsoredAssetFee Int|Unit Minimal fee in Waves

[FEATURE] Add DNS resolver to acquire seed peers

Аbstract
A gowaves node knows IP addresses of seed nodes (initial nodes to connect to) from the built-in configuration. Also the initial nodes could be provided by the command line parameter -peers. It seems better to replace or the built-in seed peers with the DNS record lookup.

Specification
Built-in configuration should support domain names along with seed nodes IP addresses. Those domain names should be resolved to underlying IP addresses and those addresses should be treated as usual seed nodes IP addresses.
The argument of -peers command line parameter should be parsed the same way as built-in configuration.

Backwards Compatibility
Configuration and -peers command line parameter should support IP addresses passing for backward compatibility.

Examples and Implementation
Bitcoin operates the same way.
https://github.com/btcsuite/btcd/blob/535f25593d47297f2c7f27fac7725c3b9b05727d/connmgr/seed.go#L33

[V1.2][RIDE V4] Update wavesBalance function

Specification

In RIDE v4 function wavesBalance(Address|Alias): BalanceDetails should return BalanceDetails structure. BalanceDetails structure consists of 4 fields:

  • regular - amount of Waves
  • available - amount of Waves that can be spent (except leased Waves)
  • effective - amount of Waves including leased Waves
  • generating - minimal amount of effective balance during 1000 last blocks

[V1.2] UpdateAssetInfo transaction

Аbstract
New transaction to update description of existing asset.

Motivation and Purposes
To allow users to change name and description of existing asset.

Specification
Transaction ID: 17.
Transaction Name: UpdateAssetInfo.
Protobuf schema: https://github.com/wavesplatform/protobuf-schemas/blob/master/proto/waves/transaction.proto.

Limits:

  • Token Name: 4 to 16 bytes.
  • Token Description: up to 1000 bytes.
  • Token description could be changed only after 100000 blocks passed since last description change.

[BUG] gRPC server always starts

Describe the bug
There is no flag to disable gRPC server.

To Reproduce
Steps to reproduce the behavior:

  1. Start the node:
./node -state-path /Users/alexeykiselev/gowaves/mainnet
  1. If there is other node with gRPC API running the error message should appear:
ERROR    grpcServer.Run(): net.Listen: listen tcp 127.0.0.1:7475: bind: address already in use

Expected behaviour
The gRPC server should not start without flag.

How to GenerateKeyPair if I have only seed

How should I receive SecretKey & PublicKey, if i have a seed? I'm using the following function:
sk, pk := crypto.GenerateKeyPair([]byte("gospel rule red grit faculty clog happy client concert final weird plastic"))

But sk and pk are not as expected. How can I receive correct sk and pk in this way?

[V1.2] Add MerkleRootHash of transactions

Аbstract
Add MerkleRootHash of block's transactions.

Motivation and Purposes
Block generator signs only block header which in turn contains a root hash of Merkle tree of all block's transactions. This change allows to verify block without downloading all block's transactions and will be used to develop sidechains.

Specification

The Merkle tree should be build as follows:

  1. Calculate the digests of all block's transactions: hash(L1), hash(L2), hash(L3) and so on.
  2. Calculate the digest of pairs of transaction's digests. For example, hash(hash(L1) + hash(L2)). If block contains odd number of transactions, the last transaction digest is used twice to calculate the pair's digest: hash (hash(L3) + hash(L3)).
  3. Repeat the step 2 until only one digest left, this is the root hash.
  4. Save the root hash in block's header.
hash (hash (hash(L1) + hash(L2)) + hash (hash(L3) + hash(L3))) = Root Hash

Notes:

  1. Transaction's digest is calculated from whole transaction including signature.
  2. Blake2b256 hash function should be used to calculate digests in Merkle tree.

Node: finish implementing RPCs for gRPC server

gRPC API has many uses, but the most important is to provide API compatibility with Scala integration tests infrastructure.
In future this will help us to fix problems detected by these integration tests.

RPCs are described in pkg/grpc/proto/*.proto files.
Generated code is is pkg/grpc. Server RPCs implementation is in pkg/grpc/server.
RPCs call node state to retrieve required information (refer pkg/state/api.go).

[BUG] go build error

github.com/wavesplatform/gowaves/pkg/crypto/internal/groth16/bls12381
....\github.com\wavesplatform\gowaves\pkg\crypto\internal\groth16\bls12381\verifier.go:16:94: cannot use inputs[i] (type *big.Int) as type *bls123
81.Fr in argument to PointG1.MulScalar

[V1.2][RIDE V4] Reimplement Issue function without nonce argument

Specification

New user function to create Issue should be implemented in addition to existing Issue constructor. This new simplified function does not have parameters compiledScript and nonce. They a filled with default values Unit and 0 accordingly.

Issue(name: String, description: String, quantity: Int, decimals: Int, isReissuable: Boolean).

New function ID should be introduced:

  • 1090 for simplified function
  • 1091 for detailed constructor

ID Issue for constructor should not be used.

[V1.2] Transition to Protobuf

Аbstract
In order to simplify support and integration use Protobuf as internal data serialisation me framework.

Specification

Use protobuf schemas from protobuf-schemas project to implement BlockV5 and 4th versions of all transactions.

Backwards Compatibility
For backward compatibility implement a new network messages to request and send BlockV5.

  • BlockV5
  • TransactionsV4
  • Network messages for BlockV5

[V1.2][RIDE V4] Change run-time limits of RIDE functions

Specification

Data limits:

  • String and ByteVector constructors - DataEntry value limit (32767 bytes)
  • String and ByteVector concatenation - DataEntry value limit (32767 bytes)
  • DataEntry key size - 400 bytes (as for protobuf Data transaction, instead of current 100 bytes)
  • max available ByteVector - (106 + 165890) = 165996 bytes (body bytes of protobuf Data transaction)

Functions:

  • sigVerify message - no limit (indirectly Data Transaction protobuf max size)
  • rsaVerify message - no limit (indirectly Data Transaction protobuf max size)

Naming limits:

  • user function and variable names length - 255 bytes (as for Callable functions)

[V1.2] Accept transactions with failed script result

Аbstract

For more information see WEP9.

Transactions with failed scripts should be stored in blockchain. All transactions with valid sender signature should be stored on blockchain even if it's script execution leads to failure. Fee for storing such transactions should be paid by sender.

Motivation and Purposes

Users of Waves blockchain can do non valid transactions without paying for it. Script execution is resource consuming operation, so transactions with failed scripts should be paid.

Specification

Transaction application should work as follows:

  1. Transaction's timestamp validation
  2. Transaction's version check
  3. Check sender's balance for available amount of spend assets
  4. Check sender's balance for available amount to pay fees
  5. Check transaction's proofs, execute verifying script
  6. Build state modifications for transaction
    6.1. For Invoke Transaction execute DApp script
    6.2. Build all resulting Invoke actions
    6.3. Execute Smart Assets scripts for all Invoke actions
    6.4. Check sender's balance for availability of additional funds to pay actions' fees
    6.5. Execute Smart Assets scripts for payments
    6.6. Execute Smart Assets scripts for actions
  7. Apply transaction

Changes to existing procedure:

  1. Check sender's balance before scripts execution
  2. Execute Smart Assets scripts after execution fo account script
  3. Execute DApp script before execution of payment's script
  4. Check sender's balance for availability of funds to pay additional fees for Invoke actions before execution of those actions scripts

Only Invoke and Exchange transactions should be stored if failed.

Backwards Compatibility

The ability to pay fee for DApp execution with funds received in attached payment will be broken.

connect public node error

c,err:=NewClient()
	require.NoError(t, err)
	block,_,err:=c.Blocks.Last(context.Background())
	require.NoError(t, err)

Error: Received unexpected
failed to decode Attachment from JSON Value: zero length string

[FEATURE] Why to run this, I need to download and store blockchain again???

Аbstract

Is your feature request related to a problem? Please describe.

Yes. Blockchain too large.

Motivation and Purposes

A clear and concise description of what the problem is. Ex. I'm always frustrated when [I need to download large files and lost the limited traffic].

Specification

A clear and concise description of what you want to happen. Describe alternatives you've considered

I just don't see the option to import the existing blockchain, or read the data inside the blocks from the already runned node. Why I need to download the binary file, to import this, when I already have synchronized blockchain???

Backwards Compatibility

Can your proposition affect any existing features?

I think, WMD can loading the blocks from the runned node, by requests on the NODE REST API,
or read the .ldb-files in the existing directory of the node, without downloading and store again the binary-file, with full blockchain (33GB).

Examples and Implementation

Examples of implementation in other projects?

https://github.com/PyWaves/WavesDataFeed make the requests on the runned node, to parse data inside the blocks, which are existing there.

[V1.2] Change the way the price calculated for OrderV4

Specification

For OrderV4 the price should be calculated as follows:

spendAmount = amountOrderV4 * priceOrderV4 * 10^(priceAssetDecimals - amountAssetDecimals - 8)

Where,

  • spendAmount - amount of assets (in normalised form) that user buys
  • amountOrderV4 - amount of assets (in normalised form) that user sells
  • priceOrderV4 - amount of assets (in normalised form) that shows ratio of assets in order's pair
  • priceAssetDecimals - number of decimals of asset from price_asset_id field
  • amountAssetDecimals - number of decimal of asset of amount_asset_id field

For Protobuf:

ExchangeTransactionData.amount() * ExchangeTransactionData.price() * 10^(ExchangeTransactionData.Order.AssetPair.price_asset_id().decimals() - ExchangeTransactionData.Order.AssetPair.amount_asset_id().decimals() - 8)

[V1.2][RIDE V4] Array functions

Specification

Implement those functions:

indexOf(list: List[T], element: T): Int|Unit
lastIndexOf(list: List[T], element: T): Int|Unit
containsElement(list: List[T], element: T): Boolean
min(list: List[Int]): Int
max(list: List[Int]): Int

[BUG] Executing Node binary on test- or stagenet causes an error.

Describe the bug
Executing Node binary on test- or stagenet causes an error.

To Reproduce
Steps to reproduce the behavior:

  1. Download 0.3.0 "Node Alpha"
  2. ./node -blockchain-type testnet
  3. See error

Error Message
ERROR failed to open genesis file: open /Users/alexeykiselev/go/src/github.com/wavesplatform/gowaves/pkg/state/genesis/stagenet.json: no such file or directory

Node: Implement the secure built-in wallet

Аbstract

Implement the secure, detachable wallet that will be used by node during new blocks generation.

Motivation and Purposes

To enable block generation on node we need a built-in wallet that holds private keys that can be used by miner for block generation. The wallet should have a storage in form of encrypted file.

Specification

  • Wallet's file format is JSON encrypted with AES.
  • Key generation algorithm like Argon2 should be used to create AES encryption key from passphrase.
  • Node should have an API method to Open/Decrypt wallet with a passphrase. This API method should be accessible only by local endpoint.
  • Node should provide an API method to Close/Detach a wallet that should unload and wipe out from memory the containing private keys.
  • Wallet should be able to store multiple accounts derived from different seed phrases/account seed.
  • User should be able to created wallet's file using special utility that should accept/generate seed phrases, account seeds or private keys in different formats.
  • Private keys inside a walled should be identified by its account.

Examples and Implementation
Ergo has a detachable wallet that could be created, opened and closed using it's API.

[V1.2] RIDE Function Families

Аbstract
In order to reduce complexity of some heavy RIDE functions make the size limited versions of such functions with various complexity depending on size of arguments.

Specification
Introduce the limited versions of following functions:

Function Argument Size Complexity
blake2b256_16Kb 16 KB 10
blake2b256_32Kb 32 KB 25
blake2b256_64Kb 64 KB 50
blake2b256_128Kb 128 KB 100
blake2b256 Unlimited (150 KB) 200
keccak256_16Kb 16 KB 10
keccak256_32Kb 32 KB 25
keccak256_64Kb 64 KB 50
keccak256_128Kb 128 KB 100
keccak256 Unlimited (150 KB) 200
sha256_16Kb 16 KB 10
sha256_32Kb 32 KB 25
sha256_64Kb 64 KB 50
sha256_128Kb 128 KB 100
sha256 Unlimited (150 KB) 200
rsaVerify_16Kb 16 KB 500
rsaVerify_32Kb 32 KB 550
rsaVerify_64Kb 64 KB 625
rsaVerify_128Kb 128 KB 750
rsaVerify Unlimited (150 KB) 1000
sigVerify_16Kb 16 KB 100
sigVerify_32Kb 32 KB 110
sigVerify_64Kb 64 KB 125
sigVerify_128Kb 128 KB 150
sigVerify Unlimited (150 KB) 200
groth16Verify_1input 1*32B 1900
groth16Verify_2inputs 2*32B 2000
groth16Verify_3inputs 3*32B 2150
groth16Verify_4inputs 4*32B 2300
groth16Verify_5inputs 5*32B 2450
groth16Verify_6inputs 6*32B 2550
groth16Verify_7inputs 7*32B 2700
groth16Verify_8inputs 8*32B 2900
groth16Verify_9inputs 9*32B 3000
groth16Verify_10inputs 10*32B 3150
groth16Verify_11inputs 11*32B 3250
groth16Verify_12inputs 12*32B 3400
groth16Verify_13inputs 13*32B 3500
groth16Verify_14inputs 14*32B 3650
groth16Verify_15inputs 15*32B 3750
groth16Verify 512B 3900

[V1.2] Implement RIDE V4 features

Specification
Implement features of RIDE V4.

  • Add Issue, Reissue and Burn actions as results to InvokeScript transaction
  • Allow attachment of 2 payments to InvokeScript transaction
  • Disable invoke with attached Payment or Transfer to itself
  • Replace DataEntry with BooleanEntry/StringEntry/BinaryEnrty/IntegerEntry
  • Remove ScriptResult/WriteSet/TransferSet
  • Check RIDE V4 activation
  • Add VRF to RIDE's BlockInfo
  • Implement new functions of RIDE V4:
    • List functions
    • Contains function for strings
    • valueOrElse() function
    • zSNARK verify
    • calculateAssetId

[BUG] NTP synchronisation produces weird current time value

Describe the bug
Sometimes, the current time is set to a moment in very far future. Possibly NTP synchronisation produces the value that overflows uint64.
The issue prevents from synchronisation of a node with the network.

StateSync: Error: block timestamp validation failed: block from future error: block's timestamp is too far in the future, current timestamp 18446742403992908309, received 1584064795750, maxTimeDrift 100, delta 3253781439057

In this example the current time was set to Sunday, 21 July 2554 23:06:43.992.

[V1.2][RIDE V4] Implement verification of ECDSA signature

Specification

Implement function ecrecover(msg: ByteVector, signature: ByteVector): ByteVector for verification of ECDSA signatures.

Parameter Type Description
msg ByteVector encrypted message
signature ByteVector proof of signing

questions about GenerateKeyPair

one pair keys generated via func GenerateKeyPair
sk,pk
YoLY4iripseWvtMt29sc89oJnjxzodDgQ9REmEPFHkK 3qTkgmBYFjdSEtib9C4b3yHiEexyJ59A5ZVjSvXsg569

when I started with this 3qTkgmBYFjdSEtib9C4b3yHiEexyJ59A5ZVjSvXsg569
then

java.lang.Exception: InvalidAddress(Wrong address string length: max=36, actual: 44)

they are really different with recipient of devnet.conf

3FgScYB6MNdnN8m4xXddQe1Bjkwmd3U7YtM
3qTkgmBYFjdSEtib9C4b3yHiEexyJ59A5ZVjSvXsg569 (generated)

anybody could tell me why?

[V1.2] [WEP8] Support VRF in Consensus

Аbstract
Add support for VRF generation signature as described in WEP8.

  • Implement VRF
  • Implement new generation signature
  • Attach activation of new VRF generation signature to BlockV5 feature activation

Node: Add support for voting on features and reward to the Miner

Аbstract
Node should have an ability to vote for features and block reward while generating a new block.

Motivation and Purposes
Now miner doesn't support voting at all, so gowaves nodes will be mute during the voting periods.

Specification
We have to add a command line parameters to give node owner the ability to select desired features to support and set the desired block reward. Later on the given parameters should be passed to miner and miner should put them in the block.
Node should not allow to vote for not implemented or already approved feature.

[FEATURE] Use TestNet scheme in tests

Аbstract
Now in tests used a mixture of MainNet and TestNet schemes. Better to stick to TestNet. Some tests that checks real objects from MainNet should use scheme accordingly.

Motivation and Purposes
Simplifying the decision which scheme to use while testing.

[FEATURE] Add support of block range requests to WMD

Аbstract
Now WMD requests blocks one-by-one using waves.node.grpc.BlocksApi/GetBlock method, in cases then it's clear that WMD have to request range of blocks better use waves.node.grpc.BlocksApi/GetBlockRange gRPC API method.

Motivation and Purposes
This part is legacy of old HTTP API, we have to use all advantages of gRPC API.

[FEATURE] Add full RIDE issued assets to WMD

Аbstract

With version 4 of RIDE assets can be issued, reissued or burnt by dApp. WMD needs full support of this new functionality.

Specification
Information about assets should be gathered not only by processing transactions, but also by processing script results of invoke transactions. We have to add support of Issue transaction and parsing of it results for assets creation and modification.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.