-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored jsonrpc to use futures 0.3 + async/await #976
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maxzaver
suggested changes
May 28, 2019
maxzaver
suggested changes
May 28, 2019
maxzaver
reviewed
May 28, 2019
c348a01
to
f0b4daa
Compare
maxzaver
approved these changes
May 28, 2019
f0b4daa
to
02b57a5
Compare
@ilblackdragon I have extracted async-utils and rebased the branch. It is ready to be merged. |
ilblackdragon
approved these changes
May 29, 2019
ilblackdragon
added a commit
that referenced
this pull request
Jun 11, 2019
* WIP Whale Fishing * First stab at single chain * Robust chain, still missing weight calcualtion and integration with runtime * Adding scaffolding for basic pool, network actor, client actor * Serving + better performance + more test coverage * Adapters between Pool and Chain. * formatting * Update primitives: sigs can convert to/from vectors; display peer message * Move store into separate cargo * Adding actix implementation of the network * Update chain to use callback instead of trait to avoid Arcs. * Add validator actor cargo * Init chain code and initial test (1/2) * Add proto encode/decode for chain and make init chain work. (2/2) * Add basic block production helper * Remove validator actor/cargo as block production is light * Chain handles orphans + test * Update RuntimeAdapter with apply transactions and fork choice rule computation * Client produces blocks * Client prints periodic summary. Network peer connect. * Block production works between two authorities. Add client test to accept external blocks. * Rename NetworkMessages to NetworkClientMessages. Small cleanups * Add myself to ghost code owner * Add integration test with 2 nodes, add test that fetches block on receival of header. * Initial propagation of peer chain state information from peers to client. * Bug fixing * Add stopping condition for two nodes test * Added banning peers if they sent invalid state (no tests yet) * Move WaitOrTimeout into test utils for peers. Move out peer manager into its own file * Clean up error reporting from process block/header * Added height/weight to the handshake * Adding basic cascade for JSONRPC server with subscriptions * Adding block producer signature to the block * Adding invalid state blocks test * Fix compile error in simple chain test * Fix tests or comment tests that are not applicable * Fix doc test * Basic approval collection for next block * Clean up peer manager tests. Adding first command line flag for the near bin * Actually start RPC server and print # authorities * Make sure coverage doesn't run forever * Playing with JsonRPC (not working) * Added timeout for waiting for other block to arrive and producing next block * Trie changes - change structure, make an storage object for temporary mutable trie nodes - normalize nodes after delete, a test for unique representation - non-recursive trie methods, an evil contract test - correctly compute refcounts - TrieChanges to support storing multiple versions in the future - Cache for storage, will be more useful later, also fix cached crate Performance got better but still a lot of time is spent allocating. * refactor refcount changes * Progress on robust node syncing * First step in integrating runtime in near cargo * More work on header syncing: added processing of sync headers to the chain, updated chain store to have cache / chain store update provides back interface to read just added items for consistent view on the 'database'. * Small fixes to prev commit * Reorg configuration for rutime/node. * Added handling for block index and test for fork change/skip blocks * Sync test passes: one peer syncs with the other one * First working JSON RPC with actix-web: send tx and query methods. * Remove unused deps * Default folder for configs * Starting to add runtime to NEAR * Moving primitives/protos/store into core/ folder * Move primitives, store and protos into core/ * Rename primitives to near-primitives * Clean up all the errors after moving things * WIP: Runtime integration * Replace GenesisConfig instead of ChainSpec * Clearning trie cache in tests * Make json rpc query work * Println cleanup * Helper scripts + report bls and tps in cli * Added support for receipts and tx status in chain. Running benchmarking: ~650-690 tps * Remove old chain, rename ghost folder to chain * Cleaning up configuration. Removed bls from InMemorySigner * Correct matching in main * Fix typo in two_nodes test and clean up unused imports * Fix tests, clean up cache usage * ClientActor into it's own file. Move out view handling from ClientActor into ViewClientActor * Fix up nearmint to work with new APIs * Remove b58 to base64 for hash, support tx status in rpc, fix up errors in nearmint * Pass chain info for status query to the Client. Correct folder for nearmint test * Added tx verification at runtime and calling it on transaction receival in client * Cleaning up: b58, config, subcommands: * Finish removing bs58: switched to base64 for keys. * Check genesis matching between config and storage. * Subcommand for near binary to clear data dir (unsafe_reset_data), * Added config option to not produce empty blocks (makes cleaner debug output) * Add retry to block production * Move protos, primitves, storage to core folder. Storage is store. Refactored how storage works. Added near/config for new Genesis config definition. Preparation for #928 merge * Disable nonworking test in jsonrpc around broadcast_tx_commut * Return back mana calculation that got removed in refactoring * Move chain/near into high level near/ * Load/store network peers in storage * Remove commented code * Use single place to call base64 in case we want to switch encoding * Print id of the node to connect, read boot nodes from config * WIP. Starting to return intergration tests. * Make Box<std::error::Error> default for TryFrom aross primitives * Remove sharding file leaked from another PR * Fix up mismerge + output logs from unittests when tx failed * Restore master's version of Trie * Make sure to delete near-* binaries for coverage * Restored test_simple for 2 peers. Added network peer exchange (5 star connection test works now). * Fix comments * Fix comments * Test for runtime handling reorgs/forks * Remove block traits/hain/consensus from primitives * Runtime return TrieChanges instead of StoreUpdate to apply insertions only for fork choice rules * Simple intergration tests pass (2, 4, 7 nodes): moved out PeerStore into separate file, fixed retrieving blocks wasn't sending the last one, sync headers wasn't validating them properly * Allocate different ports for rpc and nodes to work properly in multi-test env * Fix sync_tests and runtime_tests * Add a helper tool that runs some number of nodes in one process for quick spot check and load testing * Restore test_tps_regression * Enable test_cases_testnet_rpc integration tests * Continue working on rpc / thread node integration tests * Unify base64_format and b64_format, use it for StatusResponse. Added view_state RPC to nearmint, near, rpcuser. A bit of cleanup * Implemented jsonrpc/send_tx_commit (#975) * Implemented jsonrpc/send_tx_commit * [jsonrpc] Added polling configuration options for send_tx_commit * Remove usage of just base64::* and always use to/from base64 (prep to switch back to base58) * Ref #833: Removed ToBytes trait, cleaned up usage of BaseEncoder/From/Into traits. * Fix issues with timeouts in client. Clean up merge with master * Refactored jsonrpc to use futures 0.3 + async/await (#976) * Refactored jsonrpc to use futures 0.3 + async/await * Upgraded Rust compiler for async/await support * [CI] Replace wget with curl to avoid unnecessary dependency * Introduce timeout helper for jsonrpc async/await * Extracted the async/await helpers into async-utils crate * Continue working on #965: restored process node / rejoin integration test in progress * Working on #963: ValidatorManager does validator tracking and election. Renamed to Validators everywhere to make sure we use consistent language. * Fix not renamed parameters * Ref #963: Added ValidatorManager to the NightshadeRuntime, and hooked to the validator proposals from the transactions. Added integration test where new node becomes validator after staking. * Removed runtime/sharding folder as @SkidanovAlex working in different branch and this is outdated, clean up more namings. * Fix tests * Added test for errors on invalid tx and runtime error. Invalid tx that didn't get into mempool now returnn from broadcast_tx_commit. * Remove nearmint to speed up tests * Add HTTP interface to jsonrpc module to serve /status page by HTTP GET. Split tests into http_query, rpc_query and rpc_transactions * Ref #964: Step 1 -- start / kill NEAR node. Support not producing blocks * Ref #964: Process empty blocks works with receipts, better errors on failing to parse public keys, query rpc data takes as base58 string, test seed as an argument for near for testing * Updated nearlib in branch to work with Nightshade client * Fix issue that client wasn't finding state after restart * Balance is 128 bit number (#985) * First step toward u128 for balances: wrap u128 with Balance struct and started fixing all the usages * Finalize u128 conversion for balance * Moved out Balance into its own file. Restored wasm exports splitting u128 into 2 u64s. * Switched back Balance from newtype to alias. Moved From/TryFrom for proto into proto crate * Serialize u128 in Hex in JSON * Remove unneeded clones for amounts * Replace back Balance::default() to 0 * Fixes @nearmax suggested * Remove flatten on accountinfo as that doesn't work * Official testnet configuration (#986) * First step toward u128 for balances: wrap u128 with Balance struct and started fixing all the usages * Finalize u128 conversion for balance * Moved out Balance into its own file. Restored wasm exports splitting u128 into 2 u64s. * Add official testnet configuration + unsafe_reset_all and detecting existing configuration in home dir * Switched back Balance from newtype to alias. Moved From/TryFrom for proto into proto crate * Serialize u128 in Hex in JSON * Remove unneeded clones for amounts * Replace back Balance::default() to 0 * Fixes @nearmax suggested * Remove flatten on accountinfo as that doesn't work * Fix issue with epoch increment in validator manager * Fix wasm for u128 (#994) * Fixing WASM usage (switch to returning pointers instead of tuple) * Convert everything to points in WASM runtime * Fix rust wasm for new APIs * Switch back to debug for start_near to speed up dev (bs58 is compiled in optimized mode for debug as well). Better error when account id is invalid. * Force lock file for hello.wasm to fix CI * Add hello/out/main.wasm for now that is compiled locally as CI doesn't build * Adding proper file for hello wasm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.