create account

ARK Core: Technical Progress Update by arkecosystem

View this thread on: hive.blogpeakd.comecency.com
· @arkecosystem ·
$1.13
ARK Core: Technical Progress Update
![](https://cdn.steemitimages.com/DQmWfnA9G5bETvLBC7KDZpB9S2WVb83yHCP7hHrDMhZmEgP/image.png)

It has been 2 weeks since DevNet went live for community testing and we are very pleased with how things are progressing. We would like to thank all who have already joined to help test the new Core! As always, we would like to invite everyone else that has yet to participate to join and help out as well.

The new DevNet utilizing ARK Core v2 was launched [2 weeks ago](https://blog.ark.io/ark-core-v2-devnet-is-live-66c1023ff7d3). Since then we have fixed several bugs and implemented many new features based on community input. In addition, we have also begun testing dynamic fees and higher network throughput.

### Changes In Numbers
Over the course of last 14 days there were:
- 10 different developers contributing to the Core.
- 53 commits to the Core repository.
- 166 files changed in the Core repository.
- 978 lines of code deleted from the Core.
- 3,561 lines of code added to the Core.

### Testing
We have begun testing dynamic fees on DevNet. Every delegate can now chose their minimum acceptable fee depending on the transaction type. Here is an example of a normal transaction with a set fee of only 0.00000275 DѦ. Prior to this, v1 fees were set at a static 0.1 DѦ.

Example of a TX with Dynamic Fees as low as 0.00000275: https://dexplorer.ark.io/transaction/3585ce1b6840f6e2c63a1c5c6cbe2877ae95555030d917f3d32027d8f44254c4

Another item under testing is milestone offset by height in the configuration file. A new milestone was set at block height 21,600 and from this block forward the chain started to accept blocks with up to 150 transactions per block. This is a large increase from the previous default of 50 TPB (which is currently the same as MainNet). This successful transition has shown a solid increase of 3x in Transactions Per Second, bringing the previous 6.25 TPS to 18.75 TPS. While we are all very excited about this successful jump, please remember that we are still testing and these numbers are subject to change. The final throughput could be higher or lower for MainNet, and more testing is needed before finalizing any TPS numbers.

Example of a block with 150 TX in it:
https://dexplorer.ark.io/block/4486277915989266225

### New Features
- Blockchain ready plugin for P2P API — new plugin for the P2P API that returns a 503 Service Unavailable on certain endpoints that require the blockchain to be ready. For v1 endpoints it will return 200 Success with a body of { success: false } because that is how it was handled in the legacy P2P API where there is no proper use of status codes.
- P2P Config API — adds a new config endpoint under http://0.0.0.0:4000/config, where 4000 is the P2P port of the corresponding network, meaning it can vary between main, dev and testnet. It exposes information like versions of core and the network and other detailed information about plugins and their state.
- Immutable storage —provides an immutable storage in the form of the new package core-storage. This package makes use of https://facebook.github.io/immutable-js/ under the hood so everything that can be done by immutable.js can also be done with core-storage. core-storage only is a wrapper around immutable.js in order to make it possible to have a shared instance for in-memory information that all plugins and the core itself can access at any time without having to worry about the data in it getting modified without being told to do so. This storage can be used for peers, wallets, blockchain state, blocks and other items where the data needs to stay as initially stored.
- Criteria based peer suspensions and offender banning —The previous ban system was quite harsh, not taking the type of offense into account to implement a ban. In order to make a better assessment with regard to peer violations we have implemented the __determineSuspensionTime method. Checks will be performed on the peer in question to determine a fair ban time for each cause of trouble instead of flat out banning for 5+ hours. Previous offences are now taken into account and an offence weight is determined. If a total of 100 offence weight is reached a peer will be banned for 1 day as it is deemed to be a repeat offender.
- Setting slot height — makes it possible to set the height in the slot module of the crypto package.
- Enabled CORS for P2P post transactions endpoint — this is to match v1 transactions endpoint. Currently, the /peer/transactions endpoint is used in v1 to post transactions.
- Internal event emitting via P2P API —when the forger and relay were launched separately the emitted events would never reach the relay as the relay and forger were isolated. This will emit the given event via API to make sure the relay will be notified.
- Log usernames in forger (via P2P API) — adds the ability to log usernames in the forger as previously it did not have access to that data.
- Return broadcast IDs for better feedback —the v2 endpoint only returned IDs of accept, excess or invalid transactions. If a server doesn’t have dynamic fees enabled transactions will be broadcasted until a node is found that will forge it, but the user would not know that the transaction is being broadcasted instead of being immediately accepted.
- Tester CLI tweaks on v2 endpoints — updated Tester CLI to use only v2 endpoints, and some other small changes to the Tester.

### Fixed Bugs
- Fixed transaction processing — there was an issue with the vote test. Also issues with multi-sig because the fee is `(keysgroup + 1) * fee`, but the guard was only comparing the tx fee with the fee constant.
- Fixed blockchain not ready for usernames —if a request would be sent to the P2P API to get usernames before the node is synced it would throw a 500. This handles it by returning a response with a message.
- Cast port number when filtering peers — some peers in the peer list had the port stored as a string. We’ve added a forced-cast when filtering a specific peer on the v1 endpoint (`/api/v1/peers/get`) just as a precaution.
- Fixed delegate voters endpoint 500 error — if a delegate wasn’t found on the v1 endpoint `/api/v1/delegates/voters`, it threw a 500 error. The changes now return `success: true` and an empty array (which matches current MainNet).
- Fixed new delegate not updating —when a wallet user registers a new delegate name, it is not indexed in the wallet manager. This means that when the vote weight is recalculated at the end of each round, that wallet is not included. This has now been resolved.
- Post transaction endpoint to closer match v1 — previously the response from `/peer/transactions` always returns successful even with invalid transactions. This changes the response and brings the values more in-line with the v1 endpoint.
- Pagination v2 fixes — issues with paginated endpoints (E.g. orderBy missing, limit max not set) have been resolved.
- Fixed cast port number in peer list to number —the peer list has inconsistent JSON — all endpoints; `/peer/list`, `/api/peers` and `/api/v2/peers`. This causes issues for SDKs (e.g. C++) that require strict type mappings, where it is impossible for a value to be both a string or an integer.
- Fixed return empty object instead of array — returns an empty object to match the type of `walletsByAddress`.
- Fixed delete ID query parameter to prevent faulty query for votes — The ID parameter from the path was causing an incorrect query to be generated when requesting.
- Fixed sending too many requests to relays in forger —the forger was sending wake-up signals to all relays instead of choosing one, thereby causing excess requests resulting in missing blocks in certain cases.
- Return peer height on v2 endpoints — return height of peers when accessing v2 endpoints.
- Fixes on rebuilding MainNet — with changes to the v2 code, query has changed with code updates so it has been modified to be able to rebuild MainNet.
- Fixed bad method call on suspended peers endpoint — the suspended peers endpoint did not work due to calling non-existent methods.
- Launch P2P server before pinging peers — swapping the order in which the P2P server is started. The previous order meant that the node would try to connect with peers before its own server is online. This results in other peers trying to ping the server that is not online yet, resulting in it being suspended.
- Fixed core-p2p tests and added package to jest config.
- Fixed changed logic in getRandomPeer > keys.filter, was too permissive.

### Refactoring and Other Commits
- Keeping the relay that responded to syncCheck and syncCall, until forging is done — using the relay that responded to synCheck and making sure the relay is synced. Also no host changing between getting network state and transaction from pool. This saves time, sticking with the host that responded and is synced.
- Webhooks queue and tests — removes the use of a Redis queue for the Webhooks. Now they are immediately sent out. Also added some missing tests for the conditions.
- Use immutable Map instead of object as storage — using native Map instead of object as storage, with added tests (all, entries, keys, values) and refactoring to replace native map with immutable map.
- Reducing P2P complexity — the complexity of the P2P Interface was quite high (and still is) so this PR tries to reduce this a bit.
- Docs for GraphQL — new documentation for functions within modules and general description of modules before they are assigned. Descriptive approach to using and understanding the GraphQL plugin for Core.
- Added GraphQL tests — added fixtures for test data, queries, expected results and history. Documentation added on every module to describe exactly what its role is in the testing process.
- Use P2P port for forger in plugins config — changing the `plugins.js` to use the P2P port as default for the forger host.
- Enabled CORS for P2P config endpoint.
- Added core-database package to jest config.
- Added core-blockchain tests and package to jest config.
- Added core-transaction-pool package to jest config.
- Enabled logging of dynamic fee actions.
- Testnet DB name change.
- Added core-forger package to jest config.

The entire ARK crew would like to thank our ARK team developers and community developers for all the awesome work and time they are putting into making the new Core better and better each day — keep it up!

### How Can I Help With Development?
If you want to help, get involved and earn some extra ARK be sure to give [ARK GitHub Development Bounty](https://blog.ark.io/ark-github-development-bounty-113806ae9ffe) a read and get coding:
- ARK Core repository : https://github.com/ArkEcosystem/core
- ARK Core open issues : https://github.com/ArkEcosystem/core/issues

[ARK.io](https://ark.io) | [Github](https://github.com/ArkEcosystem) | [Facebook](https://www.facebook.com/arkecosystem) | [Twitter](https://twitter.com/ArkEcosystem) | [Forum](https://forum.ark.io) | [Blog](https://blog.ark.io) | [Explorer](https://explorer.ark.io)  | [Shop](https://shop.ark.io) | [Discord](https://discord.ark.io) | [YouTube](http://www.youtube.com/c/ARKEcosystem)
👍  , , , , , , , , , ,
properties (23)
authorarkecosystem
permlinkark-core-technical-progress-update
categoryarkecosystem
json_metadata{"tags":["arkecosystem","blockchain","cryptocurrency","ark","update"],"image":["https://cdn.steemitimages.com/DQmWfnA9G5bETvLBC7KDZpB9S2WVb83yHCP7hHrDMhZmEgP/image.png"],"links":["https://blog.ark.io/ark-core-v2-devnet-is-live-66c1023ff7d3","https://dexplorer.ark.io/transaction/3585ce1b6840f6e2c63a1c5c6cbe2877ae95555030d917f3d32027d8f44254c4","https://dexplorer.ark.io/block/4486277915989266225","http://0.0.0.0:4000/config","https://facebook.github.io/immutable-js/","https://blog.ark.io/ark-github-development-bounty-113806ae9ffe","https://github.com/ArkEcosystem/core","https://github.com/ArkEcosystem/core/issues","https://ark.io","https://github.com/ArkEcosystem","https://www.facebook.com/arkecosystem","https://twitter.com/ArkEcosystem","https://forum.ark.io","https://blog.ark.io","https://explorer.ark.io","https://shop.ark.io","https://discord.ark.io","http://www.youtube.com/c/ARKEcosystem"],"app":"steemit/0.1","format":"markdown"}
created2018-08-29 20:15:30
last_update2018-08-29 20:15:30
depth0
children0
last_payout2018-09-05 20:15:30
cashout_time1969-12-31 23:59:59
total_payout_value0.991 HBD
curator_payout_value0.140 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length11,145
author_reputation10,547,021,810,253
root_title"ARK Core: Technical Progress Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,732,563
net_rshares759,412,953,543
author_curate_reward""
vote details (11)