Commit graph

2197 commits

Author SHA1 Message Date
Nathaniel
f9fcffbb4d
Safety Check: Part 2 -- Implement and Integrate Checks
Implement a safety check mechanism on object_database, based on the
safety_check_policy abstract interface. Create two standard
implementations of the safety_check_policy interface, one
(null_safety_check) which allows all modifications unconditionally, and
the other (database_lock_safety_check) which allows modifications only
when unlocked.

Integrate these safety checks into chain::database and plugins, so that
the consensus databases are locked at all times except during core
consensus code pathways. Also ensures that databases are re-locked when
calling code outside of consensus pathways from consensus pathways.

To make this work, it was necessary to move two objects from the
consensus object spaces to a new API object space. The
operation_history_object and account_transaction_history_object were
moved to the API object space, as they are not actually used by
consensus and are maintained by a plugin (which can no longer modify the
consensus object spaces, due to the safety checks).

Finally, add a mechanism to application and chain::database, which
allows the chain to start in "unit testing mode" and allows unchecked
actions upon the database within delimited scopes. This was necessary
because many tests edit the database directly to set up the environment
for their respective tests. This mode is activated by database_fixture so
tests can utilize it conveniently, but it is architecturally difficult to
enable this mode in production, i.e. from a plugin.
2022-03-12 14:04:08 -06:00
Nathaniel
e8b432c19f
Safety Check: Part 1 -- Evaluator Tagging
Pursuant to the requested safety checks on the database, to ensure that
plugin code (i.e., third party code) cannot modify the database, we
implement evaluator tagging so the chain can distinguish between
consensus evaluators and third party evaluators. Also, define a new kind
of evaluator base class, third_party_evaluator, so that fees are not
charged multiple times for operations with multiple evaluators.

Next step, implement the actual safety check mechanism on the database.
2022-03-07 16:37:53 -06:00
Nathaniel
659d135b9b
Merge remote-tracking branch 'glu/develop' into dapp-support 2022-02-13 14:25:06 -06:00
serkixenos
fcd360c2fd Merge branch 'feature_enable_multiple_SON_support_by_default' into 'develop'
Enable multiple SON support by default

See merge request PBSA/peerplays!64
2022-02-11 17:36:26 +00:00
Vlad Dobromyslov
339adbb054 #270 functions to unified form 2022-02-11 15:41:47 +00:00
serkixenos
8b611c3f95 Merge branch 'bug/266-fee-assets' into 'develop'
#266 Fix hard-coded fee for issuing assets in sidechain plugin

See merge request PBSA/peerplays!66
2022-02-10 23:01:59 +00:00
Vlad Dobromyslov
bd08c4c6b0 #266 Fix hard-coded fee for issuing assets in sidechain plugin 2022-02-10 23:01:59 +00:00
serkixenos
a284f42ac9 Merge branch 'feature/260-voting-info' into 'develop'
#260 Added functions get_votes() and get_voters()

See merge request PBSA/peerplays!59
2022-02-10 21:11:09 +00:00
Vlad Dobromyslov
d7e24bfb07 #260 Added functions get_votes() and get_voters() 2022-02-10 21:11:08 +00:00
serkixenos
99119dbd7d Update git submodules docs and fc 2022-02-10 16:40:03 -04:00
hirunda
18bf848119 Enable multiple SON support by default 2022-02-09 18:36:03 +01:00
Nathaniel
d2ced50bbf
Bump FC 2022-02-08 11:27:26 -06:00
Vlad Dobromyslov
3a7187baba
bug #245 exception seen in witness logs 2022-02-08 11:26:34 -06:00
Vlad Dobromyslov
45e501b916
Resolve "port ES changes from Bitshares" 2022-02-08 11:26:34 -06:00
Vlad Dobromyslov
62a553ab5f
bug #267 Fix error in chain_test in gitlab autobuild 2022-02-08 11:26:34 -06:00
serkixenos
8c402d2e70
Fix list_active_son command output on deregistered SONs 2022-02-08 11:26:34 -06:00
serkixenos
dcdf406a2d
Fix cli wallet memo displaying 2022-02-08 11:26:34 -06:00
serkixenos
66699f1e15 Merge branch 'bug/245-exception-in-witness' into 'develop'
bug #245 exception seen in witness logs

See merge request PBSA/peerplays!56
2022-01-31 14:14:25 +00:00
Vlad Dobromyslov
78fbf7c3cd bug #245 exception seen in witness logs 2022-01-31 14:14:24 +00:00
Vlad Dobromyslov
39fcacd397 Resolve "port ES changes from Bitshares" 2022-01-31 05:25:56 +00:00
Nathaniel Hourt
ee0d2b21e0
Fix build
In some environments, build fails here due to `curl` dependency not being linked in time for `utilities` to see it.
2022-01-29 16:21:13 -06:00
Vlad Dobromyslov
8c3a424bb6 bug #267 Fix error in chain_test in gitlab autobuild 2022-01-28 15:05:49 +00:00
Nathaniel Hourt
2a37d8a0a1
Fix build
In some environments, this fails to build without this header.
2022-01-27 15:29:23 -06:00
Nathaniel
f667fda2e4
Merge remote-tracking branch 'origin/beatrice' into to-upstream 2022-01-26 13:16:02 -06:00
serkixenos
0bcb0487a7 Fix list_active_son command output on deregistered SONs 2022-01-21 12:17:13 -04:00
Nathaniel
d17eb5ec72
Add wallet command for custom_operation
Create a new cli_wallet command, run_custom_operation, which makes it
convenient to run custom_operation transactions which invoke third party
contracts (i.e., dapps)
2022-01-14 20:10:16 -06:00
Nathaniel
de87e1b82c
Canonicalize chain ID calculation
When using an external genesis file, it doesn't make sense to calculate
the chain ID as the literal text contents of the file, which are quite
volatile. Rather, it should be calculated based on the logical content
of the file. Serialize the genesis object to get a canonical
representation, and calculate the chain ID off of that.
2022-01-12 16:55:45 -06:00
Nathaniel
fe02a13685
Replace count_objects_in_space with inspect_all_indexes
The count_objects_in_space function, while providing the necessary
functionality, was clumsy and inconvenient, and was not idiomatic.
Replace it with inspect_all_indexes which resolves these shortcomings.
2022-01-05 17:27:52 -06:00
Michel Santos
4fea001586 Fix Bookie plugin to provide a consistent data state
even when the node is started in replay mode
2022-01-03 10:24:32 -05:00
Michel Santos
8ec87b404f Enhance secondary_index
Enhance secondary_index by distinguishing between
previous objects loaded from persistence versus
new objects created during the session
2022-01-03 09:49:44 -05:00
Michel Santos
8325b25d0e Harmonize the activation date of GPOS 2022-01-03 09:49:44 -05:00
Nathaniel
5fe3408893
Allow querying number of objects in object space
Previously, there was no good way to determine how many objects are in
an object space. Add a way to do so.
2022-01-02 14:50:17 -06:00
Nathaniel
d2dedbc4e4
Remove database unity build
Upstream dropped it and it was causing problems, so let it go!
2022-01-02 14:32:56 -06:00
Nathaniel
8df442a65f
Add secondary_index concerns
Add a way to create a secondary index with the space/type ID of the
object rather than the compile-time type, which may not always be
available.

Also, add a way to delete a secondary index (whether by compile-time
type or by object space/type ID).
2022-01-02 14:22:03 -06:00
serkixenos
5e85079281 Fix cli wallet memo displaying 2021-12-27 00:28:29 -04:00
serkixenos
f9a40c647e Increase replay's writing to database threshold 2021-12-16 22:27:34 -04:00
serkixenos
0dca13ea7e Revert change to a son_update_operation 2021-12-16 21:59:05 -04:00
serkixenos
de2a89ebce Set SON for Hive Mainnet hardfork date to 2021-12-21T00:00:00 2021-12-15 09:27:30 -04:00
serkixenos
4067291094 Remove build warnings 2021-12-08 17:07:41 +00:00
serkixenos
9ebc1ee462 Merge branch 'develop' of https://gitlab.com/PBSA/peerplays into develop 2021-12-07 13:42:46 -04:00
serkixenos
6de45cebb8 Add more mainnet seed nodes 2021-12-07 13:42:24 -04:00
yevhen
932b696556 Merging fix of bug/empty-json-parsing-failure 2021-12-07 17:40:29 +00:00
moss9001
77791b2d20 Update rpc_client.cpp 2021-12-02 15:32:15 +02:00
serkixenos
ec0398c83f Merge branch 'feature/all-in-one-build' into 'develop'
Add cmake flag to determine testnet vs mainnet build

See merge request PBSA/peerplays!40
2021-12-02 02:06:38 +00:00
serkixenos
727d54feb0 Add cmake flag to determine testnet vs mainnet build 2021-12-02 02:06:38 +00:00
serkixenos
7354de75ef cli wallet command to reactivate deregistered SON 2021-12-02 02:04:50 +00:00
serkixenos
92e017e3b0 Merge branch 'bug/35-blockchain_replay' into 'develop'
35 bug fix: when blockchain replay is attempted blocks file increases in size

See merge request PBSA/peerplays!34
2021-12-01 21:57:46 +00:00
Pavel Baykov
3612e1ec23 35 bug fix: when blockchain replay is attempted blocks file increases in size 2021-12-01 21:57:46 +00:00
serkixenos
7bc7f17b3e Fix sidechain address generation 2021-12-01 15:09:57 +00:00
serkixenos
433c75769f Fix memo field encryption 2021-11-30 22:44:55 +00:00