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

BPL v2.0.0 Release #6

Merged
merged 414 commits into from
Aug 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
414 commits
Select commit Hold shift + click to select a range
b743c8c
chore: add missing dependencies (#2599)
spkjp May 21, 2019
4d2e01a
refactor(core-p2p): remove timeout banning (#2597)
faustbrian May 22, 2019
480a73f
release: 2.4.0-next.4 (#2602)
faustbrian May 22, 2019
523618b
refactor(core-p2p): remove peer caching (#2606)
faustbrian May 22, 2019
358009c
feat(core-explorer): initial implementation (#2604)
faustbrian May 22, 2019
08a8a65
chore: add commands to check for missing dependencies and types (#2603)
faustbrian May 22, 2019
cba3065
fix(core-p2p): non-blocking port ping (#2607)
spkjp May 22, 2019
6cb7f9e
refactor(core-p2p): show mapped IPs as IPv4 (#2605)
faustbrian May 22, 2019
3cd2be2
release: 2.4.0-next.5 (#2608)
faustbrian May 22, 2019
1f6e36e
fix(core-forger): use a static reconnect timeout (#2610)
spkjp May 23, 2019
8708ec2
chore: update contribution link (#2609)
vulet May 23, 2019
4223f94
fix(core-database): assign calculated delegate ranks from temp wallet…
spkjp May 23, 2019
f790749
fix(core-wallet-api): return plugins with package names (#2613)
faustbrian May 23, 2019
1280af5
release: 2.4.0-next.6 (#2614)
faustbrian May 23, 2019
5f5152c
refactor(core-p2p): remove peer banning (#2612)
spkjp May 24, 2019
edd68b9
release: 2.4.0-next.7 (#2617)
faustbrian May 24, 2019
1316ad7
refactor(core-blockchain): remove coldstart period (#2619)
spkjp May 25, 2019
23c6182
chore(deps): update dependencies to latest versions (#2620)
faustbrian May 25, 2019
bd3912a
fix(core-snapshots): camelize block keys before bignum transformation…
air1one May 25, 2019
2cf81a0
refactor(core-transaction-pool): deserialize transactions before they…
faustbrian May 28, 2019
b49e4be
release: 2.4.0-next.8 (#2624)
faustbrian May 28, 2019
8f08910
fix(core-blockchain): chain replay stopped working after dependency u…
spkjp May 29, 2019
67c993e
fix(core-forger): wrap error message to satisfy schema (#2630)
spkjp May 29, 2019
58e3fb2
refactor(core-container): require a minimum of 0 as pubKeyHash (#2628)
vulet May 29, 2019
be8dd98
test(e2e): allow full sync testing (#2625)
air1one May 29, 2019
b434c7b
refactor: ask for a retry if installing core fails from install.sh (#…
vasild May 29, 2019
ac57453
refactor: improve database configuration in install.sh script (#2632)
vasild May 29, 2019
a832610
fix(core-webhooks): require all properties in schema and handle 404 r…
faustbrian May 30, 2019
c8f2800
fix(core-p2p): handle undefined `curr` during block download (#2636)
spkjp May 30, 2019
c8ca51f
fix(core-transaction-pool): check if transactions can still be applie…
spkjp May 30, 2019
43f0e30
release: 2.4.0-next.9 (#2637)
faustbrian May 30, 2019
0c834df
chore(changelog): add latest changes for 2.4.0 (#2638)
faustbrian May 30, 2019
002be0d
build: sequentially build modules with yarn (#2640)
spkjp May 31, 2019
a780395
feat(core-exchange-json-rpc): use @arkecosystem/core-exchange-json-rp…
faustbrian May 31, 2019
d20eed1
ci: enable node.js 12 jobs (#2631)
faustbrian Jun 1, 2019
6aa9b2f
ci: reuse steps for different node versions (#2644)
faustbrian Jun 1, 2019
34c1424
fix(core-api): off by one error in transaction confirmations (#2645)
dated Jun 2, 2019
0d63050
refactor(core-p2p): remove redundant p2p port from broadcast (#2648)
spkjp Jun 3, 2019
b6c136c
misc(core-snapshots): fix the link to the documentation (#2650)
vasild Jun 3, 2019
b00e107
refactor(core-p2p): improve logging (#2652)
spkjp Jun 4, 2019
2b431e4
fix(core): set the correct channel if core was directly installed wit…
faustbrian Jun 4, 2019
2578376
fix(core-api): invalid orderBy causes internal server error (#2653)
spkjp Jun 4, 2019
301790e
refactor(core-http-utils): remove whitelist access log (#2655)
faustbrian Jun 4, 2019
122254b
fix(core-p2p): perform `acceptNewPeer` non-blocking (#2656)
spkjp Jun 4, 2019
abe26ff
misc: reword log message and fix typo (#2658)
vasild Jun 4, 2019
84f32b8
fix(core-snapshots): avoid trying to INSERT duplicates in rounds (#2651)
vasild Jun 4, 2019
5fbf8b6
fix(core-container): handle failing optional plugins gracefully (#2657)
spkjp Jun 5, 2019
ceee129
test(core-transaction-pool): add more tests for `getTransactionsForFo…
spkjp Jun 5, 2019
974d28c
release: 2.4.0-next.10 (#2661)
faustbrian Jun 5, 2019
0a29adf
docs: 2.4.0 changelog (#2660)
faustbrian Jun 5, 2019
28441ff
fix(core-transaction-pool): correctly purge invalid transactions from…
spkjp Jun 5, 2019
2a38c9b
fix(core-snapshots): don't append duplicate rounds rows to a snapshot…
vasild Jun 5, 2019
25783ae
fix(core-transaction-pool): use temporary wallets for transaction val…
spkjp Jun 6, 2019
40183de
release: 2.4.0-next.11 (#2667)
faustbrian Jun 6, 2019
cb20751
Merge branch 'master' into develop
Jun 6, 2019
1bb6e93
fix(core-api): correctly display second signature if available (#2670)
spkjp Jun 6, 2019
145135b
fix(core-api): missing block confirmations on v2 endpoint (#2674)
spkjp Jun 8, 2019
6b7fb4b
refactor(core-transaction-pool): expire transactions that don't have …
vasild Jun 10, 2019
582d057
refactor(core-wallet-api): allow custom wallet api port (#2679)
spkjp Jun 11, 2019
9839ff0
release: 2.4.0-next.12 (#2680)
faustbrian Jun 11, 2019
a73edf4
docs: 2.4.0 changelog (#2677)
faustbrian Jun 11, 2019
d880ff8
release: 2.4.0 (#2682)
faustbrian Jun 12, 2019
9b78571
chore(docker): add CORE_LOG_LEVEL for mainnet (#2683)
faustbrian Jun 12, 2019
6c7fa66
chore(docker): add CORE_LOG_LEVEL_FILE for mainnet
faustbrian Jun 12, 2019
db09d5b
chore(docker): set core_channel for devnet
faustbrian Jun 12, 2019
b353720
chore(env): update environment files (#2684)
faustbrian Jun 12, 2019
5c9f8cc
fix(core-transaction-pool): delay transaction purge on start until af…
spkjp Jun 12, 2019
72dc441
fix(core-forger): ignore overheight block (#2687)
spkjp Jun 12, 2019
867c334
fix(core-p2p): check claimed state of peer (#2686)
spkjp Jun 12, 2019
22b823f
docs: 2.4.0 changelog (#2688)
faustbrian Jun 12, 2019
bdc911f
chore(deps): use stable @arkecosystem/exchange-json-rpc (#2681)
faustbrian Jun 12, 2019
1cbc2a0
release: 2.4.0 (#2668)
faustbrian Jun 12, 2019
8050b1f
fix(install.sh): don't fail if apt-get or yum is not found (#2690)
vasild Jun 12, 2019
d870e13
refactor(core-database-postgres): use sql to calculate fee statistics…
spkjp Jun 13, 2019
654db01
fix(core-p2p): increase rate limit to handle bigger networks (#2693)
faustbrian Jun 13, 2019
bbe38d6
revert: merge (#2694)
spkjp Jun 13, 2019
5aad7f9
release: 2.4.1 (#2695)
faustbrian Jun 13, 2019
0ff5241
refactor(core-api): remove the legacy API and support asset search (#…
faustbrian Jun 13, 2019
c201c70
perf(crypto): cache genesis transaction ids (#2699)
spkjp Jun 14, 2019
f983e2c
fix(core-blockchain): take milestones into account when downloading b…
spkjp Jun 14, 2019
c780f66
release: 2.4.12 (#2701)
faustbrian Jun 14, 2019
025dfce
Merge branch 'master' into develop
Jun 14, 2019
c96cf3f
release: 2.5.0-next.0 (#2702)
faustbrian Jun 14, 2019
d5c719c
release: 2.5.0-next.1 (#2704)
faustbrian Jun 14, 2019
5fa4049
fix(core-p2p): add 2.5 to minimum versions (#2703)
faustbrian Jun 14, 2019
8b8c433
docs(changelog): fix formatting
faustbrian Jun 14, 2019
a0ba29b
fix(core-database-postgres): possible database corruption when writin…
spkjp Jun 15, 2019
0e55dff
chore(core-database-postgres): add foreign key on transactions block …
vasild Jun 15, 2019
ad0e44a
release: 2.5.0-next.2 (#2713)
faustbrian Jun 17, 2019
90187e4
fix(core-api): use CORE_API_DISABLED variable in defaults (#2711)
faustbrian Jun 17, 2019
8c3c38a
refactor(core-p2p): only look for new peers when below minimum peers …
spkjp Jun 17, 2019
a6373f3
feat(core-webhooks): add option to configure request timeout (#2710)
faustbrian Jun 17, 2019
d9f4218
release: 2.5.0-next.3
Jun 17, 2019
2ec6df4
feat(core-wallet-api): impose the same rate limit as the public API (…
faustbrian Jun 18, 2019
24fa281
refactor(core-wallet-api): always keep the Wallet API enabled (#2715)
faustbrian Jun 18, 2019
5c03914
chore(core-p2p): allow 2.4 and 2.5 nodes (#2716)
faustbrian Jun 18, 2019
b0bcb12
fix(core-p2p): forget peer when socket is disconnected (#2720)
spkjp Jun 18, 2019
a819326
perf(core-p2p): improve peer block header check (#2719)
spkjp Jun 18, 2019
3f088a6
refactor(core-p2p): only fetch block headers when verifying peers (#2…
spkjp Jun 20, 2019
142dc3d
refactor(core-p2p): delay peer discovery until after state initializa…
spkjp Jun 20, 2019
582b8c3
refactor(core-http-utils): remove createSecureServer method (#2730)
faustbrian Jun 20, 2019
4176f3a
refactor(core-p2p): improved rate limiting (#2729)
spkjp Jun 20, 2019
92c0a3d
fix(core-p2p): off-by-one error when fetching blocks from peer (#2733)
spkjp Jun 21, 2019
49e25f8
fix(core): check for user confirmation in snapshot commands (#2734)
faustbrian Jun 21, 2019
8d45678
test(core-api): transformer service and 404 assertions (#2735)
faustbrian Jun 21, 2019
e1de9d1
refactor(core-wallet-api): respect the whitelist of the public API (#…
faustbrian Jun 21, 2019
2db650b
test(core-api): test /transactions/fees and /blockchain endpoints (#2…
faustbrian Jun 21, 2019
f34edcf
test(core-api): /node/configuration/crypto endpoint (#2737)
faustbrian Jun 21, 2019
fd2d056
test(core-api): /node/fees endpoint (#2738)
faustbrian Jun 21, 2019
9c7520e
chore(docker): Add Wallets API, remove PostgreSQL container port defa…
adrian69 Jun 21, 2019
b29f364
docs(docker): Updated README (#2742)
adrian69 Jun 21, 2019
31b4d70
misc(core-p2p): log all socket errors (#2731)
vasild Jun 22, 2019
239080b
refactor(core-database-postgres): exit on unexpected error (#2744)
spkjp Jun 24, 2019
5ae7f4e
perf(core-p2p): download serialized blocks (#2743)
spkjp Jun 24, 2019
66ecd74
refactor(core-p2p): block when rate limit exceeded (#2745)
spkjp Jun 25, 2019
2633741
fix(core-blockchain): always attempt to download blocks after start (…
spkjp Jun 25, 2019
924aa4b
release: 2.5.0-next.4 (#2747)
faustbrian Jun 25, 2019
5a7392c
fix(core-utils): grant access if the whitelist is empty (#2748)
faustbrian Jun 25, 2019
657d97b
release: 2.5.0-next.5 (#2749)
faustbrian Jun 25, 2019
d67fc61
fix: do not purge transactions when a block is not accepted (#2751)
spkjp Jun 26, 2019
58c6450
release: 2.4.13 (#2752)
faustbrian Jun 26, 2019
a959565
Merge branch 'master' into develop
Jun 26, 2019
80aa5ff
fix: previous round order calculation (#2754)
spkjp Jun 27, 2019
4dfe51a
refactor(core-database-postgres): check error code instead of e… (#2755)
spkjp Jun 27, 2019
16ace9d
fix: treat and return BigInt values as strings (#2739)
faustbrian Jun 27, 2019
4c688c6
feat(core-api): return timestamp from /node/status (#2758)
spkjp Jun 27, 2019
9b1e64f
refactor(core-transaction-pool): remove blockSender (#2756)
spkjp Jun 27, 2019
3fc1fb2
fix(install.sh): check ntp status as sudo
faustbrian Jun 27, 2019
7f0662b
fix(install.sh): grep ntp status
faustbrian Jun 27, 2019
a917758
fix(core-blockchain): revert accepted blocks when saveBlocks fails (#…
spkjp Jun 28, 2019
05194a2
fix(install.sh): check ntp status as sudo
faustbrian Jun 27, 2019
9c647aa
fix(install.sh): grep ntp status
faustbrian Jun 27, 2019
1d5c408
chore(docker): Add Wallets API, remove PostgreSQL container port defa…
adrian69 Jun 21, 2019
6edcb93
docs(docker): Updated README (#2742)
adrian69 Jun 21, 2019
7cf4d7e
fix: install.sh and docker (#2762)
faustbrian Jun 28, 2019
7199090
refactor(core-database-postgres): remove the id column from rounds (#…
vasild Jun 28, 2019
134fdf6
fix(core-snapshots): do not restore genesis block with wrong id (#2759)
vasild Jun 28, 2019
7909ca5
fix(core-p2p): avoid iterating on non-iterable peerBlocks (#2763)
vasild Jul 2, 2019
51240b3
fix(core-database-postgres): correct estimate if less than limit rows…
vasild Jul 2, 2019
fcc8a23
fix: try harder to return the requested number of transactions (#2765)
vasild Jul 2, 2019
0f19122
fix(core-transaction-pool): try harder to return the requested number…
spkjp Jul 2, 2019
f0c2d72
release: 2.4.14 (#2767)
faustbrian Jul 2, 2019
df7401d
Merge branch 'master' into develop
Jul 2, 2019
f163023
fix(crypto): reject future and expired transaction timestamps (#2757)
spkjp Jul 2, 2019
05cc9b9
release: 2.5.0-next.6 (#2769)
faustbrian Jul 2, 2019
8a1ecce
refactor: delete last block if deserialization fails (#2770)
spkjp Jul 3, 2019
5e17b5a
refactor(core-p2p): discover new peers sooner (#2771)
spkjp Jul 3, 2019
4d91e47
BPL Testnet v2.0.0-pre.4 (#3)
toucansam-bpl Jul 3, 2019
7de758b
feat(core-database-postgres): enforce chained blocks at database leve…
vasild Jul 4, 2019
9fbe0b7
Node 11 -> node 10 for v18
Jul 4, 2019
e9f2878
Fix for install on Ubuntu 18
toucansam-bpl Jul 4, 2019
bc9d295
fix(core-p2p): TypeError: Reduce of empty array with no initial value…
spkjp Jul 5, 2019
8c540ca
fix(core-database-postgres): drop check_previous_block with arguments…
faustbrian Jul 5, 2019
43bbb3f
chore(deps): update dependencies to latest versions (#2768)
faustbrian Jul 5, 2019
1e185ea
feat(core-api): make it configurable whether to use estimates (#2772)
vasild Jul 5, 2019
733a62e
release: 2.5.0-next.7 (#2776)
faustbrian Jul 6, 2019
9bccd10
fix(crypto): raise bignumber maximum (#2777)
spkjp Jul 6, 2019
1df3b0e
backport: some fixes for the deployer (#2782)
spkjp Jul 9, 2019
cead487
release: 2.4.15 (#2783)
faustbrian Jul 9, 2019
59aed5d
refactor(core): run GC earlier on potatos (#2785)
spkjp Jul 9, 2019
1c01a08
fix(crypto): allow future timestamps up to 3600 + blocktime seconds (…
alessiodf Jul 9, 2019
c642f89
refactor(core-http-utils): always enforce `application/json` as conte…
spkjp Jul 10, 2019
4267236
refactor(core-forger): increase timeout, check time left in slot (#2788)
spkjp Jul 10, 2019
c384625
refactor(core-p2p): refresh peer ports (#2784)
spkjp Jul 10, 2019
34c1b56
feat(install): let the user choose if they want to use @next release …
spkjp Jul 10, 2019
566ec29
Merge branch 'master' into develop
Jul 10, 2019
dddeaf1
docs(changelog): 2.5.0 (#2790)
faustbrian Jul 10, 2019
766870e
revert: let the user choose if they want to use @next release (#2793)
spkjp Jul 10, 2019
ec68d39
fix(core-forger): also check if still in same slot (#2792)
spkjp Jul 10, 2019
c385d7a
release: 2.5.0-next.8 (#2794)
faustbrian Jul 10, 2019
009e815
release: 2.5.0-next.9 (#2796)
faustbrian Jul 10, 2019
9ea7fed
fix(core-api): handle null url and malformed JSON payloads (#2797)
spkjp Jul 11, 2019
f48b2d8
release: 2.5.0 (#2798)
faustbrian Jul 11, 2019
c17a83f
docs(changelog): remove reverted PR from 2.5.0
faustbrian Jul 11, 2019
a160194
chore(deps): bump @arkecosystem/exchange-json-rpc to 1.0.1 (#2799)
faustbrian Jul 11, 2019
3675ebb
release: 2.5.0 (#2795)
faustbrian Jul 11, 2019
8f8a078
fix(core-http-utils): loading of ssl certificate (#2800)
spkjp Jul 11, 2019
77675f3
release: 2.5.1 (#2801)
faustbrian Jul 11, 2019
ae1cb1d
fix(core-p2p): accepted versions (#2802)
spkjp Jul 12, 2019
dadfea4
fix(core-snapshots): also fix the genesis block id during verify (#2809)
vasild Jul 15, 2019
ce8ea1f
chore(deps): update dependencies to their latest versions (#2808)
faustbrian Jul 15, 2019
26a6c0d
fix(core-snapshots): also fix the genesis block id during verif… (#2811)
faustbrian Jul 15, 2019
8bc6567
chore(crypto): export dist/index.js for cjs and umd (#2807)
faustbrian Jul 15, 2019
3afb6e2
perf(core-database): lookup wallets by keys (#2810)
faustbrian Jul 15, 2019
ace7755
release: 2.5.7 (#2812)
faustbrian Jul 16, 2019
f18327d
build(docker): add ntp and google servers for ntpd (#2823)
faustbrian Jul 17, 2019
5a5a056
chore: setup codacy configuration (#2827)
faustbrian Jul 17, 2019
1eaa40f
chore: ignore development folders on codacy
faustbrian Jul 17, 2019
d2209b7
chore: setup probot/stale configuration (#2834)
faustbrian Jul 22, 2019
1f5c1d4
chore(readme): add lead maintainer information (#2835)
faustbrian Jul 22, 2019
594b0b3
perf(core-database): lookup delegates by key (#2837)
spkjp Jul 23, 2019
8c1a0ff
fix(core-utils): add content-type header (#2840)
spkjp Jul 25, 2019
757b7f5
fix(core-api): return data directly if cache is disabled (#2831)
faustbrian Jul 26, 2019
8d85f24
merged ark/2.5.7
Jul 27, 2019
c5ccf17
@arkecosystem -> @blockpool-io
Jul 28, 2019
40fda89
ark 2.5.7 -> bpl 2.0.0-pre.5
Jul 28, 2019
82e7db8
arkToSatoshi -> bplToSatoshi, arktoshi -> bpltoshi
Jul 28, 2019
b9d61a3
Updated install scripts
Jul 28, 2019
1cec709
Updated default accepted versions
Jul 28, 2019
258a394
Updated .env files
Jul 28, 2019
df7678c
update genesis block and milestones to include additional properties
Jul 28, 2019
7582cca
v2.0.0-pre.6
Jul 28, 2019
4c5339b
Updates to allow project to compile
Jul 28, 2019
a9d350e
Umm yeah
Jul 28, 2019
8eb3d36
v2.0.0-pre.8
Jul 28, 2019
b7f09a7
Fixed some references
Jul 28, 2019
7282f66
v2.0.0-pre.10
Jul 28, 2019
618ff5b
Fixed another build error
Jul 28, 2019
af683e5
v2.0.0-pre.12
Jul 28, 2019
8200388
Updated non-snapshot dependent env files for mainnet/devnet
Jul 29, 2019
b9a7600
v2.0.0-pre.14
Jul 29, 2019
2857935
rolled back lerna version
Jul 29, 2019
fb5c6d3
Updated testnet plugin defaults
Jul 29, 2019
aab7165
v2.0.0-pre.13
Jul 29, 2019
ac1a572
Updated devnet plugin defaults
Jul 29, 2019
11ebeef
v2.0.0-pre.15
Jul 29, 2019
07e5b0d
Fixed package version issues
Jul 29, 2019
1eb2e92
v2.0.0-pre.17
Jul 29, 2019
40d1ada
Updated devnet genesis block
Jul 29, 2019
2a6ed31
v2.0.0-pre.19
Jul 29, 2019
1e48d4d
fix(core-api): internal server error caused by invalid orderBy field …
spkjp Jul 29, 2019
fd05231
Updated crypto package to test deployment fail
Jul 30, 2019
dcea52a
v2.0.0-pre.21
Jul 30, 2019
869faf2
Removed fuzzy matching on blockpool packages
Jul 30, 2019
ca36061
v2.0.0-pre.23
Jul 30, 2019
b12483b
perf(core-p2p): improve transactions endpoint (#2848)
spkjp Jul 30, 2019
487e2da
Changed from pre to rc to avoid incorrect installs
Jul 30, 2019
4b31fa3
Updated lerna version
Jul 30, 2019
6945ef5
v2.0.0-rc.2
Jul 30, 2019
d0d3a3a
Normalized versions again
Jul 30, 2019
3a62ac5
v2.0.1-rc.0
Jul 30, 2019
c34fd75
fix(core-p2p): peer discovery limit (#2850)
spkjp Jul 30, 2019
fe3cc2f
release: 2.5.14 (#2849)
faustbrian Jul 30, 2019
f814b87
release: 2.5.14
Jul 30, 2019
a9e7077
Bumped core-interfaces to proper version
Jul 30, 2019
efa641e
v2.0.2-rc.1
Jul 30, 2019
4226585
Updated all packages to 2.0.0-rc.3
Jul 31, 2019
f29fc29
updated devnet specifics
Jul 31, 2019
49f311d
Updated package versions for publish
Aug 1, 2019
d84ff14
Updated minimum versions
Aug 3, 2019
0f4cd5a
Update to ARK 2.5.7 (#5)
toucansam-bpl Aug 3, 2019
8e6aac7
Merge remote-tracking branch 'bpl/bpl_testnet' into bpl_testnet
Aug 3, 2019
b63a333
Version 2.0.0
Aug 3, 2019
7fac7bb
Merge ark 2.5.14
Aug 3, 2019
953f3a2
Modified version to 2.0.0 to match bpl_mainnet branch and eliminate m…
Aug 3, 2019
596c028
Update to ark 2.5.14
Aug 3, 2019
eeed5fc
Updated mainnet specific files
Aug 3, 2019
d6514c0
Release 2.5.14
Aug 3, 2019
55775b2
Fixed a reference and updated milestones so that it does not expect f…
Aug 3, 2019
5d4f07b
Bumped crypto version
Aug 3, 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
Prev Previous commit
Next Next commit
fix(core-snapshots): don't append duplicate rounds rows to a snapshot (
…ArkEcosystem#2662)

When appending to an existent snapshot, only append rows with higher id
than already in the (old) snapshot. Otherwise the snapshot would contain
rows with duplciate rounds.id values and would not be importable.

This patch assumes no gaps in rounds.id and monotonically increasing
rounds.id when new rounds are being added.
  • Loading branch information
vasild authored and spkjp committed Jun 5, 2019
commit 2a38c9be9d6072613c61fd62bb6492905a64ec5a
22 changes: 15 additions & 7 deletions packages/core-snapshots/src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,25 @@ export class Database {
return this.getLastBlock();
}

public async getExportQueries(startHeight, endHeight) {
const startBlock = await this.getBlockByHeight(startHeight);
const endBlock = await this.getBlockByHeight(endHeight);
public async getExportQueries(meta: {
startHeight: number,
endHeight: number,
startRoundId: number,
skipCompression: boolean,
folder: string
}) {

const startBlock = await this.getBlockByHeight(meta.startHeight);
const endBlock = await this.getBlockByHeight(meta.endHeight);

if (!startBlock || !endBlock) {
app.forceExit(
"Wrong input height parameters for building export queries. Blocks at height not found in db.",
);
}

const roundInfoStart: Shared.IRoundInfo = roundCalculator.calculateRound(startHeight);
const roundInfoEnd: Shared.IRoundInfo = roundCalculator.calculateRound(endHeight);
const roundInfoStart: Shared.IRoundInfo = roundCalculator.calculateRound(meta.startHeight);
const roundInfoEnd: Shared.IRoundInfo = roundCalculator.calculateRound(meta.endHeight);

return {
blocks: rawQuery(this.pgp, queries.blocks.heightRange, {
Expand All @@ -105,8 +112,9 @@ export class Database {
end: endBlock.timestamp,
}),
rounds: rawQuery(this.pgp, queries.rounds.roundRange, {
start: roundInfoStart.round,
end: roundInfoEnd.round,
startRound: roundInfoStart.round,
endRound: roundInfoEnd.round,
startId: meta.startRoundId
}),
};
}
Expand Down
5 changes: 3 additions & 2 deletions packages/core-snapshots/src/db/queries/rounds/round-range.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SELECT
FROM
rounds
WHERE
round BETWEEN ${start} AND ${end}
round BETWEEN ${startRound} AND ${endRound} AND
id >= ${startId}
ORDER BY
round
id
2 changes: 1 addition & 1 deletion packages/core-snapshots/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class SnapshotManager {
}

params.meta = utils.setSnapshotInfo(params, lastBlock);
params.queries = await this.database.getExportQueries(params.meta.startHeight, params.meta.endHeight);
params.queries = await this.database.getExportQueries(params.meta);

if (params.blocks) {
if (options.blocks === params.meta.folder) {
Expand Down
2 changes: 2 additions & 0 deletions packages/core-snapshots/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const setSnapshotInfo = (options, lastBlock) => {
const meta = {
startHeight: options.start !== -1 ? options.start : 1,
endHeight: options.end !== -1 ? options.end : lastBlock.height,
startRoundId: 1,
skipCompression: options.skipCompression || false,
folder: "",
};
Expand All @@ -99,6 +100,7 @@ export const setSnapshotInfo = (options, lastBlock) => {
if (options.blocks) {
const oldMeta = this.getSnapshotInfo(options.blocks);
meta.startHeight = oldMeta.endHeight + 1;
meta.startRoundId = oldMeta.rounds.count + 1;
meta.folder = `${oldMeta.startHeight}-${meta.endHeight}`;
}

Expand Down