From cd459ee9d4402c89b4855cb4f606d2534b702c25 Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Fri, 23 Feb 2018 11:00:07 -0300 Subject: [PATCH 1/9] Create bsip-0036.md --- bsip-0036.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 bsip-0036.md diff --git a/bsip-0036.md b/bsip-0036.md new file mode 100644 index 0000000..1d3272a --- /dev/null +++ b/bsip-0036.md @@ -0,0 +1,73 @@ + BSIP: 0036 + Title: Remove expired feeds + Author: oxarbitrage + Status: Draft + Type: Protocol + Created: 2018-02-22 + Discussion: https://github.com/bitshares/bitshares-core/issues/518 + Replaces: - + Worker: To be done + +# Abstract + +Currently, expired bitasset feeds remain in the blockchain forever. The only way to get them erased is if operation `update_feed_producers` is called with new publishers on the asset. At this call, and only at this case, old publisher feeds will be deleted from the blockchain. If this operation never occurs or if it occurs maintaining some or all of the same publishers feeds will not be removed. + +Some examples of this are the followings, where we can see feeds from 2015: + +- http://open-explorer.io/#/objects/2.4.9 - HKD +- http://open-explorer.io/#/objects/2.4.21 - USD +- http://open-explorer.io/#/objects/2.4.10 - RUB +- etc. + +This BSIP proposes a protocol change to remove expired feeds at maintenance time. + +# Motivation + +Improve performance of the bitshares-core. + + +# Rationale + +This expired feeds are unnecessary, they clutter up the database and cause unnecessary burden on undo_db. + +# Specifications + +As mentioned in the abstract feeds stay in the blockchain forever unless `asset_update_feed_producers_evaluator::do_apply` is called. + +The BSIP proposes to remove expired feeds at maintenance time by adding feed cleanup code at `db_main.cpp`. + +Solution is not that simple, `asset_update_bitasset_operation` can change `feed_expiration_time` and `minimum_feeds` required for the asset. + +If a feed is expired and the `feed_expiration_time` changes, expired feeds may became valid, similar if `minimum_feeds` (required to calculate the median) is increased, older feeds may became valid and used by the core market engine if available. + +This scenario actually happened in the past and that is the reason the change will fail unless a hardfork protection is added. + +## The proposed solution + +Goal is to remove expired feeds in a safe manner. To do this we need to keep current behavior before hardfork date and only remove feeds at maintenance intervals after the hardfork. This will allow the chain to synchronize and start the cleanup at a point where all the feeds are valid, safely being able to remove them an continue clean from that time on. + +This a permanent hardfork, code before hardfork date will work one way(current behavior) and after date new code will work different making the feed cleanup at maintenance times. + +Feed cleanup code will only be executed after proposed hardfork date, at the first maintenance interval after date old feeds will be removed, node will not be able to use them anymore as they will not be available in the database. + +If `asset_update_bitasset_operation` is called before hardfork operation will be normal as it is currently is now. + +If `asset_update_bitasset_operation` is called after hardfork and increases the `minimum_feeds` while they are not enough feeds `update_median_feeds()` will set a null feed. This is current `asset_update_bitasset_operation`, no need to make any change in the operation. + + +# Discussion + +[to be added if any] + +# Summary for Shareholders + +[to be added if any] + +# Copyright + +This document is placed in the public domain. + +# See Also + +* https://github.com/bitshares/bitshares-core/issues/518 +* https://github.com/bitshares/bitshares-core/pull/598 From 2bd11aedaceaf02b2c5c9610c25661eef6a2c5e7 Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Fri, 23 Feb 2018 11:43:57 -0300 Subject: [PATCH 2/9] Create bsip-0037.md --- bsip-0037.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 bsip-0037.md diff --git a/bsip-0037.md b/bsip-0037.md new file mode 100644 index 0000000..fe4adb9 --- /dev/null +++ b/bsip-0037.md @@ -0,0 +1,64 @@ + BSIP: 0037 + Title: Extend created asset names + Author: oxarbitrage + Status: Draft + Type: Protocol + Created: 2018-02-23 + Discussion: https://github.com/bitshares/bitshares-core/issues/620 + Replaces: - + Worker: To be done + +# Abstract + +Currently, the bitshares-core do not allow asset creation that start or end with a numerical character. Creation of index style assets like `CRYPTO500` are not possible. + +This BSIP proposes a protocol change to allow number characters at the end of the created asset name. + +# Motivation + +Economical, enable more asset names to be created in the exchange. + + +# Rationale + +No valid reason was found until now about why this is not allowed. The creation of index style assets will bring new business to the exchange. + +# Specifications + +Restriction in asset names are detailed in `asset_ops.cpp`: + +``` +/** + * Valid symbols can contain [A-Z0-9], and '.' + * They must start with [A, Z] + * They must end with [A, Z] + * They can contain a maximum of one '.' + */ + ``` + + BSIP proposes to change third rule to: + + `They must end with [A, Z0-9]` + +As file where the changes are needed(`asset_ops.cpp`) do not have access to the database, we are unable to use `head_block_time()` to create the hardfork guard. + +The process is more complicated and it is described as follows:(quote from @abit in github ticker: https://github.com/bitshares/bitshares-core/issues/620#issuecomment-364803143): + +"To make the change, need to loose the validation code in `asset_ops.cpp`, add a hard fork guard code with original rule to asset_evaluator to make sure no rule change before the hard fork, add corresponding hard fork guard code in proposal_evaluator. After hard fork, those hard fork guard code can be safely removed." + +# Discussion + +[to be added if any] + +# Summary for Shareholders + +[to be added if any] + +# Copyright + +This document is placed in the public domain. + +# See Also + +* https://github.com/bitshares/bitshares-core/issues/620 +* https://github.com/bitshares/bsips/issues/52 From c4d424aa5782af99204a5a79eeee8eff0aa8647a Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Fri, 23 Feb 2018 14:56:02 -0300 Subject: [PATCH 3/9] change rationale --- bsip-0036.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsip-0036.md b/bsip-0036.md index 1d3272a..d7b1c14 100644 --- a/bsip-0036.md +++ b/bsip-0036.md @@ -28,7 +28,7 @@ Improve performance of the bitshares-core. # Rationale -This expired feeds are unnecessary, they clutter up the database and cause unnecessary burden on undo_db. +The proposed change only affects the feed price when the feed expiration time is increased. This rarely happens, if ever, so in practice the effect on pricing is negligible. The savings in performance however, is not. # Specifications From e3914d5f033384fab1b4f1a8efbf9dc285a12f22 Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Fri, 23 Feb 2018 14:58:48 -0300 Subject: [PATCH 4/9] change discussion link --- bsip-0036.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsip-0036.md b/bsip-0036.md index d7b1c14..4d94062 100644 --- a/bsip-0036.md +++ b/bsip-0036.md @@ -4,7 +4,7 @@ Status: Draft Type: Protocol Created: 2018-02-22 - Discussion: https://github.com/bitshares/bitshares-core/issues/518 + Discussion: https://bitsharestalk.org/index.php?topic=25996.0 Replaces: - Worker: To be done @@ -57,7 +57,7 @@ If `asset_update_bitasset_operation` is called after hardfork and increases the # Discussion -[to be added if any] +https://bitsharestalk.org/index.php?topic=25996.0 # Summary for Shareholders From 52a530fd8efd9523b70a789d6b11643abc5c3d4d Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Fri, 23 Feb 2018 15:01:50 -0300 Subject: [PATCH 5/9] change discussion link --- bsip-0037.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsip-0037.md b/bsip-0037.md index fe4adb9..2da8421 100644 --- a/bsip-0037.md +++ b/bsip-0037.md @@ -4,7 +4,7 @@ Status: Draft Type: Protocol Created: 2018-02-23 - Discussion: https://github.com/bitshares/bitshares-core/issues/620 + Discussion: https://bitsharestalk.org/index.php?topic=25997.0 Replaces: - Worker: To be done @@ -48,7 +48,7 @@ The process is more complicated and it is described as follows:(quote from @abit # Discussion -[to be added if any] +https://bitsharestalk.org/index.php?topic=25997.0 # Summary for Shareholders From a1b438c7e05876f53abbbf941fa28fe0b8b1abd9 Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Sun, 25 Feb 2018 13:42:35 -0300 Subject: [PATCH 6/9] add bsip 36 and 37 to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 9e50470..b065dae 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,7 @@ Number | Title | [32](bsip-0032.md) | Always Match Orders At Maker Price | Abit More | Protocol | Draft [33](bsip-0033.md) | Maker Orders With Better Prices Take Precedence | Abit More | Protocol | Draft [34](bsip-0034.md) | Always Trigger Margin Call When Call Price Above Or At Price Feed | Abit More | Protocol | Draft +[36](bsip-0036.md) | Remove expired feeds | oxarbitrage | Protocol | Draft +[37](bsip-0037.md) | Extend created asset names | oxarbitrage | Protocol | Draft + + From 90c7abb725521f79d569d00fd42275241c18fddc Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Sun, 25 Feb 2018 19:42:30 -0300 Subject: [PATCH 7/9] change bsip 36 and 37 titles --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b065dae..281daac 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Number | Title | [32](bsip-0032.md) | Always Match Orders At Maker Price | Abit More | Protocol | Draft [33](bsip-0033.md) | Maker Orders With Better Prices Take Precedence | Abit More | Protocol | Draft [34](bsip-0034.md) | Always Trigger Margin Call When Call Price Above Or At Price Feed | Abit More | Protocol | Draft -[36](bsip-0036.md) | Remove expired feeds | oxarbitrage | Protocol | Draft -[37](bsip-0037.md) | Extend created asset names | oxarbitrage | Protocol | Draft +[36](bsip-0036.md) | Remove expired price feeds on maintenance interval | oxarbitrage | Protocol | Draft +[37](bsip-0037.md) | Allow new asset name to end with a number | oxarbitrage | Protocol | Draft From e56ccde0229d8acc1f9a76228983d8290510cbfc Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Sun, 25 Feb 2018 19:43:54 -0300 Subject: [PATCH 8/9] change title --- bsip-0036.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsip-0036.md b/bsip-0036.md index 4d94062..067ca59 100644 --- a/bsip-0036.md +++ b/bsip-0036.md @@ -1,5 +1,5 @@ BSIP: 0036 - Title: Remove expired feeds + Title: Remove expired price feeds on maintenance interval Author: oxarbitrage Status: Draft Type: Protocol From b5d70d616f93f5d325b6c4f9ee721fb94cc24014 Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Sun, 25 Feb 2018 19:45:17 -0300 Subject: [PATCH 9/9] change title --- bsip-0037.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsip-0037.md b/bsip-0037.md index 2da8421..e9c32ee 100644 --- a/bsip-0037.md +++ b/bsip-0037.md @@ -1,5 +1,5 @@ BSIP: 0037 - Title: Extend created asset names + Title: Allow new asset name to end with a number Author: oxarbitrage Status: Draft Type: Protocol