Skip to content
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

fix batch-pbft overload & forks issue #102

Merged
merged 216 commits into from
Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes from 160 commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
1e95f15
resolve conflicts of net message sending, enqueue pbft msgs into sync…
VincentOCL Mar 19, 2019
c20cee9
merge pbft feature into bos, resolve conflicts in block extension usage
VincentOCL Mar 20, 2019
7bda6a3
fix merge error in get_table_tests
VincentOCL Mar 20, 2019
22acbf9
txn plugin now use system newaccount to create account and support cu…
qianxiaofeng Mar 5, 2019
a1ee007
don't stop if push transaction failed
qianxiaofeng Mar 21, 2019
cb89b32
don't stop if push transaction failed
qianxiaofeng Mar 22, 2019
037dbb6
bug fix: cannot find block, use block state ptr to mark pbft prepare …
VincentOCL Mar 25, 2019
f564829
Merge branch 'feature/dpos-pbft-bos-v2.0.2' into feature/bos-dpos-pbf…
qianxiaofeng Mar 25, 2019
5679479
clear prepared (my prepare) id when it becomes invalid.
VincentOCL Mar 28, 2019
1977fc0
init commit for upgrade solution
VincentOCL Mar 29, 2019
1ec967e
add migration function, hack load function for forkdb.dat
qianxiaofeng Mar 30, 2019
55fcd20
hardcoded consensus upgrade at 1000.
VincentOCL Apr 2, 2019
0493444
disable proposed schedule promotion during upgrading
VincentOCL Apr 3, 2019
8b737cc
add system contract support
VincentOCL Apr 3, 2019
35ce2cf
add upo assertion, target block num must be at least 100 more than cu…
VincentOCL Apr 4, 2019
2e96766
some code reformat
VincentOCL Apr 4, 2019
d424438
add newly built system contract to `contracts/eosio.system` folder
VincentOCL Apr 4, 2019
458be93
add pbft_plugin as default plugins
VincentOCL Apr 5, 2019
dab790e
revert eosio.system contract; upgrade version can be found from a for…
VincentOCL Apr 5, 2019
5d90ba1
txn plugin now use system newaccount to create account and support cu…
qianxiaofeng Mar 22, 2019
1d02e6f
Merge branch 'feature/dpos-pbft-bos-upgrade' into test_bos_master
qianxiaofeng Apr 10, 2019
434385f
try to fix gpo propose block num inconsistent bug
qianxiaofeng Apr 10, 2019
e61b533
solve consensus chosen conflict when upgrade
qianxiaofeng Apr 12, 2019
28605a3
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
Apr 12, 2019
4ab5c0f
bug fix: shouldn't print upgrade log when chain is fresh started
qianxiaofeng Apr 12, 2019
6d68dc3
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
Apr 12, 2019
2d60f58
reject target setting when it is upgrading or has just upgraded.
VincentOCL Apr 15, 2019
83427a1
add new view related log.
VincentOCL Apr 15, 2019
c9cfa3e
add new view sending related log.
VincentOCL Apr 15, 2019
387d55a
add new view transition raw bytes.
VincentOCL Apr 16, 2019
1f27be4
print all error raw bytes.
VincentOCL Apr 17, 2019
9ebb308
add error net message length.
VincentOCL Apr 17, 2019
e87b2d1
move local buf vector into connection
VincentOCL Apr 17, 2019
d11e76e
Revert "move local buf vector into connection"
VincentOCL Apr 17, 2019
6f0f7b9
add new view transition raw bytes.
VincentOCL Apr 17, 2019
58e5f39
reformat some functions
VincentOCL Apr 18, 2019
48f54b6
Merge branch 'feature/dpos-pbft-bos-upgrade' into feature/bos-dpos-pb…
qianxiaofeng Apr 18, 2019
1b16811
remove debug logs.
VincentOCL Apr 18, 2019
52ec637
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
qianxiaofeng Apr 18, 2019
ebf8d3b
stop setting head as my prepare during switching fork
VincentOCL Apr 18, 2019
fc25167
Merge pull request #82 from boscore/release/2.0.x
Thaipanda Apr 18, 2019
b6382fc
mark pbft prepared (my prepared) with previous block's attr upon adding
VincentOCL Apr 18, 2019
59c4aef
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
qianxiaofeng Apr 18, 2019
94c4541
Removed centralized pipelines
kj4ezj Apr 18, 2019
d02605a
Merge pull request #7162 from EOSIO/zach-1.6-buildkite
kj4ezj Apr 19, 2019
06ebc4a
wait a while for edge case when conn reset
qianxiaofeng Apr 19, 2019
9514546
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
qianxiaofeng Apr 19, 2019
c412442
Reduce logging of complete object when unable to serialize
heifner Apr 19, 2019
af8ed71
Add demangle of type
heifner Apr 19, 2019
3c2d562
Merge pull request #7170 from EOSIO/reduce-noise-1.6.x
heifner Apr 19, 2019
f10f136
Merge branch 'feature/bos-dpos-pbft-tps' into feature/dpos-pbft-bos-u…
qianxiaofeng Apr 22, 2019
2ef3770
merge develop
qianxiaofeng Apr 22, 2019
08b5ba5
resolve conflicts in fork db prune
VincentOCL Apr 22, 2019
55a94a7
attempt switching forks upon new view.
VincentOCL Apr 22, 2019
19f0894
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
qianxiaofeng Apr 22, 2019
a540740
stop switching upon new view
VincentOCL Apr 22, 2019
8094eeb
skip watermark check in new version
VincentOCL Apr 22, 2019
8679765
remove all my prepare mark upon new view; using transit_to_committed …
VincentOCL Apr 23, 2019
c8092f7
bug fix: itr bug during removing marks
VincentOCL Apr 23, 2019
5093652
Merge branch 'feature/dpos-pbft-bos-upgrade' into feature/dpos-pbft-b…
qianxiaofeng Apr 24, 2019
c5bea21
Merge branch 'feature/dpos-pbft-bos-upgrade' into feature/dpos-pbft-b…
qianxiaofeng Apr 24, 2019
06aa979
fix unit_test
qianxiaofeng Apr 24, 2019
d45f20c
Keep block log open to minimize open/close of file
heifner Apr 23, 2019
b32829c
Merge pull request #7198 from EOSIO/keep-block-log-open-1.6.x
heifner Apr 24, 2019
0c085d2
allow opening block log with no blocks (fixes undefined behavior bug)…
arhag Apr 23, 2019
a70c609
Merge pull request #7201 from EOSIO/fix-block-log-bugs-1.6.x
heifner Apr 24, 2019
3b48e8e
Merge remote-tracking branch 'remotes/origin/feature/dpos-pbft-bos-up…
VincentOCL Apr 25, 2019
9f1e648
add prepare watermarks
VincentOCL Apr 25, 2019
de03c3d
bug fix: only request checkpoints in new version
VincentOCL Apr 25, 2019
12f934c
Bump to 1.6.5
heifner Apr 25, 2019
b3229de
Merge pull request #7209 from EOSIO/bump-to-1.6.5
heifner Apr 25, 2019
ef0ccfa
resolve inconsistency in `is_upgrading` calculation.
VincentOCL Apr 26, 2019
1231a2b
bug fix: return empty if upgrade target block equals to default.
VincentOCL Apr 26, 2019
4a637f6
bug fix: compare schedule between pending checkpoint & lscb (instead …
VincentOCL Apr 26, 2019
295092f
update the actiondemo
pursonc Apr 26, 2019
39c2182
Update to fc with gcc7 fix
heifner Apr 26, 2019
33d102c
update actiondemo script for random testing
pursonc Apr 27, 2019
1b33765
Merge branch 'develop' into randomtest
pursonc Apr 27, 2019
8f305f5
bug fix: modified the start of new version
VincentOCL Apr 27, 2019
9f44c2e
bug fix: add null ptr check during fetching scp from blk extn.
VincentOCL Apr 27, 2019
d9c9a54
add upgrade related log.
VincentOCL Apr 27, 2019
739ec29
Merge pull request #86 from boscore/randomtest
Thaipanda Apr 27, 2019
d1a9009
migration support for snapshot
qianxiaofeng Apr 27, 2019
b4bdc9e
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng Apr 27, 2019
66e7de2
upgrade log formatted
VincentOCL Apr 27, 2019
b85b91e
change type of ucb in upo.
VincentOCL Apr 28, 2019
4c24d23
bugfix: snapshot migration prefer vector<char> to string
qianxiaofeng Apr 28, 2019
630154a
add new version debug log
VincentOCL Apr 28, 2019
0490bff
mark fork_db regardless of the version; new version now is when head …
VincentOCL Apr 29, 2019
be6c4f5
add more log , to be revert soon
qianxiaofeng Apr 29, 2019
bff6990
bug fix: force generate upo if not found.
VincentOCL Apr 29, 2019
4eebe6a
fix unit test
qianxiaofeng Apr 29, 2019
ee63bfa
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
qianxiaofeng Apr 29, 2019
43f1749
Merge branch 'develop' into release/3.0.x
qianxiaofeng Apr 30, 2019
9f0cde3
remove debug log; reformat new view validation; revert txn_test_gen_p…
VincentOCL Apr 30, 2019
cd99520
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
VincentOCL Apr 30, 2019
57e14e4
Merge branch 'develop' into feature/dpos-pbft-bos-upgrade
qianxiaofeng Apr 30, 2019
d3e4f5f
Merge pull request #87 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Apr 30, 2019
f235892
Merge pull request #88 from boscore/develop
Thaipanda Apr 30, 2019
96b3e81
prepare v3.0.0
Thaipanda Apr 30, 2019
f622254
bug fix: sort vectors before intersection.
VincentOCL Apr 30, 2019
f5091e7
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
VincentOCL Apr 30, 2019
d8cd42e
sort view change and producer vector before intersection.
VincentOCL Apr 30, 2019
6c65226
Merge pull request #89 from boscore/feature/bug-fix-pbft-validation
Thaipanda Apr 30, 2019
59c5bf6
Merge pull request #90 from boscore/develop
Thaipanda Apr 30, 2019
0d6ffa0
Determine flags for pgrep dynamicly instead of by list of hosts
heifner Apr 29, 2019
665f334
Add missing import or re
heifner Apr 29, 2019
081377c
Merge pull request #7225 from EOSIO/update-fc-v1.6.x
heifner Apr 30, 2019
707e8c9
force attempt to switch forks upon set_pbft_lib.
VincentOCL May 1, 2019
822201b
attempt to switch forks after mark fork db.
VincentOCL May 1, 2019
e08fb6b
Change default log level from debug to info.
heifner May 1, 2019
3779200
Merge pull request #7244 from EOSIO/log-level-v1.6.x
heifner May 1, 2019
41c8d6f
add committed cert info view change & new view;
VincentOCL May 2, 2019
24f5c46
add pbft test case
qianxiaofeng May 2, 2019
55c047d
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng May 2, 2019
b5be2d9
Created test metrics Buildkite job
kj4ezj May 3, 2019
aaae581
Added universal pipeline configuration file
kj4ezj May 3, 2019
3af72ef
add test case switch_fork_when_accept_new_view_with_prepare_certifica…
qianxiaofeng May 3, 2019
b2331bb
bug fix: pbft switch fork to short lib
qianxiaofeng May 3, 2019
8347331
Do not fail build due to metrics
kj4ezj May 3, 2019
98d2e24
Added check for skipped jobs
kj4ezj May 3, 2019
63f6b46
Return exit success in Buildkite so we don't prevent PRs from being m…
kj4ezj May 3, 2019
e7c66db
sort committed cert before apply; move upgrade status into controller…
VincentOCL May 3, 2019
ad8ee81
bugfix:fix snapshot integrity test
qianxiaofeng May 3, 2019
0a21031
Merge pull request #7258 from EOSIO/zach-1.6-test-metrics
kj4ezj May 3, 2019
84be1d1
Merge branch 'develop' into feature/dpos-pbft-bos-upgrade
qianxiaofeng May 4, 2019
76fc46f
Merge pull request #91 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda May 5, 2019
5636899
Merge pull request #92 from boscore/develop
Thaipanda May 5, 2019
b6de91f
Added eosio-nightly-builds pipeline to pipeline.jsonc
kj4ezj May 6, 2019
aa678f9
Merge pull request #7270 from EOSIO/zach-1.6-pipeline-config
kj4ezj May 6, 2019
4f4ef31
bugfix: fork_db migration incorrect pos align
qianxiaofeng May 7, 2019
6a24939
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng May 7, 2019
a8b5875
bug fix: return default block id when trying to fetch block num 0; up…
VincentOCL May 8, 2019
720b617
add migration log
qianxiaofeng May 8, 2019
e1a52bd
improve: change algorithm in LIB upgrade fork database migration, hug…
qianxiaofeng May 8, 2019
79ee901
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
qianxiaofeng May 8, 2019
27e4177
use schedule in ucb when there is no stable checkpoint.
VincentOCL May 8, 2019
5184306
update snapshot migration logic to reflect struct change in block hea…
qianxiaofeng May 10, 2019
ddc3e61
add forkdb block states into snapshot after pbft is enabled; fix repl…
VincentOCL May 10, 2019
899ee7a
change block producing log
VincentOCL May 11, 2019
4c677e0
Merge branch 'develop' into feature/dpos-pbft-bos-upgrade
qianxiaofeng May 11, 2019
9407bcf
feature/dpos-pbft-bos-upgrade bugfix and snapshot support (#94)
qianxiaofeng May 11, 2019
290df19
Use debug level logging when --verbose output requested
heifner May 11, 2019
78d1094
Merge pull request #7332 from EOSIO/verbose-unittest-1.6.x
heifner May 11, 2019
d64e611
Merge pull request #95 from boscore/develop
Thaipanda May 12, 2019
e2a0abf
update tps plugin, now tps trx support symbol BOS and cal cpu/net bill
qianxiaofeng May 13, 2019
c6e44f3
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng May 13, 2019
eb964cb
fix a potential crash during commit cert generation.
VincentOCL May 13, 2019
2c2ddd7
fix typo.
VincentOCL May 13, 2019
8b8c9b3
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
VincentOCL May 13, 2019
f9e86b1
Merge branch 'develop' into feature/dpos-pbft-bos-upgrade
qianxiaofeng May 13, 2019
3edf744
update readme in txn generator plugin
qianxiaofeng May 13, 2019
3264995
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng May 13, 2019
9ee66b4
Merge pull request #96 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda May 13, 2019
82de16b
Merge pull request #97 from boscore/develop
Thaipanda May 13, 2019
a28493e
fix potential crash when calculating integrity hash
VincentOCL May 14, 2019
8dad318
fix snapshot's container reading in different os.
VincentOCL May 14, 2019
183afb5
Created "version-label" Integration Test
kj4ezj May 14, 2019
8318e4c
Finish test purpose comment
kj4ezj May 14, 2019
37beebe
reformat snapshot sections; reformat getting block state in pbft_db.
VincentOCL May 15, 2019
ec893e6
Merge branch 'develop' into feature/dpos-pbft-bos-upgrade
oldcold May 15, 2019
47c063f
Merge pull request #7355 from EOSIO/zach-1.6-version-label
kj4ezj May 15, 2019
1cc5e17
re-struct pbft message; compress pbft new view
May 17, 2019
902177a
add new view primary check; add debug info during prepare (commit) in…
May 18, 2019
cf75956
optimise cal in `should_recv_pbft_msg` and `should_send_pbft_msg`; do…
May 21, 2019
3c45326
generate pbft watermark from forkdb.
May 22, 2019
303c12d
generate pbft watermark from forkdb.
May 22, 2019
5c566ca
Removed eosio pipeline files
kj4ezj May 24, 2019
1deb26d
Merge pull request #7411 from EOSIO/zach-1.6-centralize-eosio-pipeline
kj4ezj May 24, 2019
0f63be7
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
VincentOCL May 28, 2019
db44a76
testing mac base-images
May 28, 2019
9d8645c
Merge pull request #7426 from EOSIO/1.6.x-pipeline-base-images
NorseGaud May 28, 2019
f475fa6
add pbft_api_plugin
May 29, 2019
8a1c39c
increase pbft message deadline
May 30, 2019
56110e0
increase new view message deadline; add prepared & my_prepare in pbft…
May 30, 2019
7b241d5
re-struct pbft message; compress pbft new view
May 17, 2019
2b24e2b
Reference to shared_ptr can be invalidated by completion of push_tran…
heifner May 30, 2019
895e47a
Merge pull request #7438 from EOSIO/gh7436-sigsegv-1.6.x
heifner May 30, 2019
3b7068b
fix bug in new view decompression.
May 31, 2019
601c8c6
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade-sl…
VincentOCL May 31, 2019
fd444d2
optimise scp sync; move upo creation into `update_pbft_status`;
Jun 2, 2019
a63265f
fix bug in loading old version snapshots.
Jun 3, 2019
9b0e8fc
fix assignment during timer creation
spoonincode Jun 3, 2019
ca8cc91
Merge pull request #7456 from EOSIO/fix_timer_assign_16x
arhag Jun 4, 2019
befad2f
bump version to 1.6.6
arhag Jun 4, 2019
21d7fcc
Merge pull request #7463 from EOSIO/bump-version-to-1.6.6
arhag Jun 4, 2019
45ad108
add message_type in pbft messages; refactor code.
Jun 4, 2019
dde4c39
Merge branch 'feature/dpos-pbft-bos-upgrade-slim' into feature/dpos-p…
VincentOCL Jun 6, 2019
7c9404e
remove pbft controller config; fix net layer bugs.
Jun 6, 2019
74bde5c
bug fix: view change certs generation;
Jun 6, 2019
2ffcf15
retry sending all pending checkpoints;
Jun 7, 2019
299f82f
check all prepares (commits) fall on the same fork during generating …
Jun 8, 2019
01775ea
add pre_prepares in prepared_cert, requesting missing blocks upon vie…
Jun 11, 2019
a3d05a0
bug fix: reset view change state cache properly.
Jun 12, 2019
ec4f5e9
add debug log for testing
Jun 13, 2019
3dd5850
Merge pull request #100 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Jun 13, 2019
5b1c188
bug fix: add watermark check during marking prepared state.
Jun 13, 2019
b6b59a1
retry sending my lscb
Jun 13, 2019
e18d397
reformat net layer debug log.
Jun 14, 2019
5c2cf58
Merge pull request #101 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Jun 14, 2019
bb0f372
add pbft_api_plugin doc
Jun 14, 2019
8679935
Merge pull request #104 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Jun 14, 2019
a6e0e6d
fix pbft testcases
Jun 15, 2019
f8d517b
stay at view change state when there is no valid stable checkpoint
Jun 15, 2019
16c2e27
Merge pull request #105 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Jun 16, 2019
52208ea
merge eos v1.6.6
Jun 17, 2019
4666ad6
Merge pull request #106 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Jun 18, 2019
a043e54
adjust the EOSIO version
Thaipanda Jun 18, 2019
68c4886
optimise pbft message body
VincentOCL Jun 19, 2019
f652819
optimise stable checkpoints sync
Jun 21, 2019
fe0a4ae
optimise stable checkpoints sync, based on bos-v0.11.0
Jun 21, 2019
9d5d835
bug fix: checkpoints db prune.
Jun 23, 2019
0e2cbc1
prune all blocks which are below current lscb in fork_db
Jun 25, 2019
6334a0c
add socket opening check during `start_read_message`
Jun 27, 2019
73ca674
fix for compatibility.
Jun 27, 2019
9354e34
Merge pull request #107 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Jun 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_EXTENSIONS ON )
set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 2)
set(VERSION_MAJOR 3)
set(VERSION_MINOR 0)
set(VERSION_PATCH 3)
set(VERSION_PATCH 0)

if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
Expand Down
4 changes: 2 additions & 2 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cd bos/Docker
docker build . -t boscore/bos -s BOS
```

The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v2.0.3 tag, you could do the following:
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v3.0.0 tag, you could do the following:

```bash
docker build -t boscore/bos:v2.0.3 --build-arg branch=v2.0.3 .
docker build -t boscore/bos:v3.0.0 --build-arg branch=v3.0.0 .

```

Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BOSCore - Born for DApps. Born for Usability.

## BOSCore Version: v2.0.3
## BOSCore Version: v3.0.0
### Basic EOSIO Version: v1.6.4 (support REX)

# Background
Expand Down Expand Up @@ -39,16 +39,6 @@ Attention:
3. Treat update of eosio/eos code as new feature.
4. Emergent issues must repaired by adopting hotfixes mode.

## BOSCore Workflow
BOSCore encourage community developer actively participate in contributing the code, members should follow the workflow below.
![BOSCore Workflow](./images/bos-workflow.png)

Attention:
1. Only allow Feature Branch or bug fix to submit PR to Develop Branch.
2. Rebase is required before submitting PR to Develop Branch.
3. Treat update of eosio/eos code as new feature.
4. Emergent issues must repaired by adopting hotfixes mode.

BOSCore bases on EOSIO, so you can also referer:

[Getting Started](https://developers.eos.io/eosio-nodeos/docs/overview-1)
Expand Down
12 changes: 1 addition & 11 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BOSCore - 更可用的链,为DApp而生。

## BOSCore Version: v2.0.3
## BOSCore Version: v3.0.0
### Basic EOSIO Version: v1.6.4 (support REX)

# 背景
Expand Down Expand Up @@ -39,16 +39,6 @@ BOSCore 鼓励社区开发者参与代码贡献,社区成员应当遵循以下
3. EOSIO 主网版本作为一个 Feature Branch 来对待
4. 紧急问题修复采用 hotfixes 模式

## BOSCore 开发流程
BOSCore 鼓励社区开发者参与代码贡献,社区成员应当遵循以下工作流:
![BOSCore Workflow](./images/bos-workflow.png)

注意:
1. 只有待发布的 Feature Branch 或者Bug修复才应该向 Develop Branch 提交
2. 向 Develop Branch 提交 PR 之前需要现在本地执行 rebase 操作
3. EOSIO 主网版本作为一个 Feature Branch 来对待
4. 紧急问题修复采用 hotfixes 模式

BOSCore是基于EOSIO技术的扩展,所以EOSIO的相关资料也可以参考:

[EOSIO 开始](https://developers.eos.io/eosio-nodeos/docs/overview-1)
Expand Down
2 changes: 1 addition & 1 deletion contracts/eosio.system/delegate_bandwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ namespace eosiosystem {

auto fee = ( tokens_out.amount + 199 ) / 200; /// .5% fee (round up)
// since tokens_out.amount was asserted to be at least 2 earlier, fee.amount < tokens_out.amount

if( fee > 0 ) {
INLINE_ACTION_SENDER(eosio::token, transfer)( N(eosio.token), {account,N(active)},
{ account, N(eosio.ramfee), asset(fee), std::string("sell ram fee") } );
Expand Down
2 changes: 1 addition & 1 deletion contracts/eosio.system/eosio.system.abi
Original file line number Diff line number Diff line change
Expand Up @@ -575,4 +575,4 @@
],
"ricardian_clauses": [],
"abi_extensions": []
}
}
2 changes: 1 addition & 1 deletion contracts/eosio.system/exchange_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace eosiosystem {

uint64_t primary_key()const { return supply.symbol; }

asset convert_to_exchange( connector& c, asset in );
asset convert_to_exchange( connector& c, asset in );
asset convert_from_exchange( connector& c, asset in );
asset convert( asset from, symbol_type to );

Expand Down
7 changes: 7 additions & 0 deletions contracts/eosiolib/eosiolib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ namespace eosio {
ds >> params;
}

void set_upgrade_parameters(const eosio::upgrade_parameters& params) {
char buf[sizeof(eosio::upgrade_parameters)];
eosio::datastream<char *> ds( buf, sizeof(buf) );
ds << params;
set_upgrade_parameters_packed( buf, ds.tellp() );
}

using ::memset;
using ::memcpy;

Expand Down
1 change: 1 addition & 0 deletions contracts/eosiolib/privileged.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ extern "C" {
*/
uint32_t get_blockchain_parameters_packed(char* data, uint32_t datalen);

void set_upgrade_parameters_packed(char* data, uint32_t datalen);
/**
* @brief Activate new feature
* Activate new feature
Expand Down
10 changes: 10 additions & 0 deletions contracts/eosiolib/privileged.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ namespace eosio {
)
};

struct upgrade_parameters {
uint32_t target_block_num;

EOSLIB_SERIALIZE(upgrade_parameters,
(target_block_num)
)
};

/**
* @brief Set the blockchain parameters
* Set the blockchain parameters
Expand All @@ -122,6 +130,8 @@ namespace eosio {
*/
void get_blockchain_parameters(eosio::blockchain_parameters& params);

void set_upgrade_parameters(const eosio::upgrade_parameters& params);

///@} priviledgedcppapi

/**
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ add_library( eosio_chain
block_header_state.cpp
block_state.cpp
fork_database.cpp
pbft_database.cpp
pbft.cpp
controller.cpp
authorization_manager.cpp
resource_limits.cpp
Expand Down
77 changes: 55 additions & 22 deletions libraries/chain/block_header_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace eosio { namespace chain {
* contain a transaction mroot, action mroot, or new_producers as those components
* are derived from chain state.
*/
block_header_state block_header_state::generate_next( block_timestamp_type when )const {
block_header_state block_header_state::generate_next( block_timestamp_type when, bool pbft_enabled )const {
block_header_state result;

if( when != block_timestamp_type() ) {
Expand Down Expand Up @@ -62,9 +62,17 @@ namespace eosio { namespace chain {
result.pending_schedule = pending_schedule;
result.dpos_proposed_irreversible_blocknum = dpos_proposed_irreversible_blocknum;
result.bft_irreversible_blocknum = bft_irreversible_blocknum;
result.pbft_stable_checkpoint_blocknum = pbft_stable_checkpoint_blocknum;


if (pbft_enabled) {
result.dpos_irreversible_blocknum = dpos_irreversible_blocknum;
} else {
result.producer_to_last_implied_irb[prokey.producer_name] = result.dpos_proposed_irreversible_blocknum;
result.dpos_irreversible_blocknum = result.calc_dpos_last_irreversible();
}


result.producer_to_last_implied_irb[prokey.producer_name] = result.dpos_proposed_irreversible_blocknum;
result.dpos_irreversible_blocknum = result.calc_dpos_last_irreversible();

/// grow the confirmed count
static_assert(std::numeric_limits<uint8_t>::max() >= (config::max_producers * 2 / 3) + 1, "8bit confirmations may not be able to hold all of the needed confirmations");
Expand All @@ -73,23 +81,30 @@ namespace eosio { namespace chain {
auto num_active_producers = active_schedule.producers.size();
uint32_t required_confs = (uint32_t)(num_active_producers * 2 / 3) + 1;

if( confirm_count.size() < config::maximum_tracked_dpos_confirmations ) {
result.confirm_count.reserve( confirm_count.size() + 1 );
result.confirm_count = confirm_count;
result.confirm_count.resize( confirm_count.size() + 1 );
result.confirm_count.back() = (uint8_t)required_confs;
} else {
result.confirm_count.resize( confirm_count.size() );
memcpy( &result.confirm_count[0], &confirm_count[1], confirm_count.size() - 1 );
result.confirm_count.back() = (uint8_t)required_confs;
if (!pbft_enabled) {
if (confirm_count.size() < config::maximum_tracked_dpos_confirmations) {
result.confirm_count.reserve(confirm_count.size() + 1);
result.confirm_count = confirm_count;
result.confirm_count.resize(confirm_count.size() + 1);
result.confirm_count.back() = (uint8_t) required_confs;
} else {
result.confirm_count.resize(confirm_count.size());
memcpy(&result.confirm_count[0], &confirm_count[1], confirm_count.size() - 1);
result.confirm_count.back() = (uint8_t) required_confs;
}
}

return result;
} /// generate_next

bool block_header_state::maybe_promote_pending() {
if( pending_schedule.producers.size() &&
dpos_irreversible_blocknum >= pending_schedule_lib_num )
bool block_header_state::maybe_promote_pending( bool pbft_enabled ) {

bool should_promote_pending = pending_schedule.producers.size();
if ( !pbft_enabled ) {
should_promote_pending = should_promote_pending && dpos_irreversible_blocknum >= pending_schedule_lib_num;
}

if (should_promote_pending)
{
active_schedule = move( pending_schedule );

Expand All @@ -99,7 +114,13 @@ namespace eosio { namespace chain {
if( existing != producer_to_last_produced.end() ) {
new_producer_to_last_produced[pro.producer_name] = existing->second;
} else {
new_producer_to_last_produced[pro.producer_name] = dpos_irreversible_blocknum;
//TODO: max of bft and dpos lib
if (pbft_enabled) {
new_producer_to_last_produced[pro.producer_name] = bft_irreversible_blocknum;
} else {
new_producer_to_last_produced[pro.producer_name] = dpos_irreversible_blocknum;
}

}
}

Expand All @@ -109,7 +130,13 @@ namespace eosio { namespace chain {
if( existing != producer_to_last_implied_irb.end() ) {
new_producer_to_last_implied_irb[pro.producer_name] = existing->second;
} else {
new_producer_to_last_implied_irb[pro.producer_name] = dpos_irreversible_blocknum;
//TODO: max of bft and dpos lib
if (pbft_enabled) {
new_producer_to_last_implied_irb[pro.producer_name] = bft_irreversible_blocknum;
} else {
new_producer_to_last_implied_irb[pro.producer_name] = dpos_irreversible_blocknum;
}

}
}

Expand Down Expand Up @@ -141,13 +168,13 @@ namespace eosio { namespace chain {
*
* If the header specifies new_producers then apply them accordingly.
*/
block_header_state block_header_state::next( const signed_block_header& h, bool skip_validate_signee )const {
block_header_state block_header_state::next( const signed_block_header& h, bool skip_validate_signee, bool pbft_enabled )const {
EOS_ASSERT( h.timestamp != block_timestamp_type(), block_validate_exception, "", ("h",h) );
//EOS_ASSERT( h.header_extensions.size() == 0, block_validate_exception, "no supported extensions" );

EOS_ASSERT( h.timestamp > header.timestamp, block_validate_exception, "block must be later in time" );
EOS_ASSERT( h.previous == id, unlinkable_block_exception, "block must link to current state" );
auto result = generate_next( h.timestamp );
auto result = generate_next( h.timestamp, pbft_enabled);
EOS_ASSERT( result.header.producer == h.producer, wrong_producer, "wrong producer specified" );
EOS_ASSERT( result.header.schedule_version == h.schedule_version, producer_schedule_exception, "schedule_version in signed block is corrupted" );

Expand All @@ -161,9 +188,11 @@ namespace eosio { namespace chain {
/// below this point is state changes that cannot be validated with headers alone, but never-the-less,
/// must result in header state changes

result.set_confirmed( h.confirmed );

auto was_pending_promoted = result.maybe_promote_pending();
result.set_confirmed(h.confirmed, pbft_enabled);


auto was_pending_promoted = result.maybe_promote_pending(pbft_enabled);

if( h.new_producers ) {
EOS_ASSERT( !was_pending_promoted, producer_schedule_exception, "cannot set pending producer schedule in the same block in which pending was promoted to active" );
Expand All @@ -185,14 +214,18 @@ namespace eosio { namespace chain {
return result;
} /// next

void block_header_state::set_confirmed( uint16_t num_prev_blocks ) {
void block_header_state::set_confirmed( uint16_t num_prev_blocks, bool pbft_enabled ) {
/*
idump((num_prev_blocks)(confirm_count.size()));

for( uint32_t i = 0; i < confirm_count.size(); ++i ) {
std::cerr << "confirm_count["<<i<<"] = " << int(confirm_count[i]) << "\n";
}
*/
if (pbft_enabled) {
header.confirmed = 0;
return;
}
header.confirmed = num_prev_blocks;

int32_t i = (int32_t)(confirm_count.size() - 1);
Expand Down
8 changes: 4 additions & 4 deletions libraries/chain/block_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

namespace eosio { namespace chain {

block_state::block_state( const block_header_state& prev, block_timestamp_type when )
:block_header_state( prev.generate_next( when ) ),
block_state::block_state( const block_header_state& prev, block_timestamp_type when, bool pbft_enabled )
:block_header_state( prev.generate_next( when, pbft_enabled) ),
block( std::make_shared<signed_block>() )
{
static_cast<block_header&>(*block) = header;
}

block_state::block_state( const block_header_state& prev, signed_block_ptr b, bool skip_validate_signee )
:block_header_state( prev.next( *b, skip_validate_signee )), block( move(b) )
block_state::block_state( const block_header_state& prev, signed_block_ptr b, bool skip_validate_signee, bool pbft_enabled )
:block_header_state( prev.next( *b, skip_validate_signee, pbft_enabled)), block( move(b) )
{ }


Expand Down
Loading