Commit Graph

3072 Commits

Author SHA1 Message Date
catbref
f4022dd243 initial work on adding bundled node-management UI 2019-07-23 12:37:42 +01:00
catbref
99024ee2ef Synchronization improvements
Don't attempt to sync, or generate blocks, if we think we're not up to date.

Notify Controller of newly generated block AFTER releasing blockchain lock.

Loads of changes to synchronizer.

Added missing GET_PEERS handling to Controller.onNetworkMessage.

More detailed peer information (last block sig, last generator sig, last block timestamp, ...)
New HEIGHT_V2 network message to help support above.

More, and improved, logging.

Fix for HSQLDB serialization failure caused by trying to save the same new transaction
received by more than one peer/thread simultaneously.
2019-07-23 12:22:17 +01:00
catbref
23bcba1650 HSQLDBRepository.toOffsetDateTime now returns null if passed null 2019-07-23 12:10:47 +01:00
catbref
58afb53be9 Rename getReferenceGeneratorSignature to getGeneratorSignatureFromReference 2019-07-23 11:46:16 +01:00
catbref
0cb54abb79 Fix bug in checking transaction group-approval threshold 2019-07-23 11:30:07 +01:00
catbref
8b949dc1a1 Added simplistic blockchain validation on startup 2019-07-23 11:29:35 +01:00
catbref
f167d0c831 Add JAXB discriminator to GROUP_INVITE transactions. 2019-07-23 11:25:36 +01:00
catbref
b2f235f7a5 Changes to API regarding proxy forging calls 2019-07-23 11:24:25 +01:00
catbref
f3c588d90f Fix sometimes erroneous Ed25519 public key to X25519 public key conversion.
Added mass (x1000) testing of key conversion and shared secret calculations.

Fix incorrect proxy private key test that has expected result from previous
algorithm.

Added another test HTML/JS file.
2019-07-23 11:22:23 +01:00
catbref
1b4369e5e8 Default settings changes
Use IPv6 wildcard address "::" for P2P bind address as null
seems to make listen socket bind to 127.0.0.1

Increase target minimum outbound connections from 3 to 10.

Increate maximum connection limit from 10 to 30.
2019-07-23 11:17:31 +01:00
catbref
c917191df2 Send network broadcasts over all handshake-completed peers.
Previously we preferred the outbound connection but actually
this leaves our info about inbound connection peers out of date.

Synchronizer still prefers outbound.
2019-07-23 11:17:06 +01:00
catbref
1046f72e7b Slightly better logging for synchronizer 2019-07-23 11:16:02 +01:00
catbref
8f7c954f5a Proxy private keys are now SHA256(shared secret only) instead of SHA256(shared secret + public keys).
HTML/JS in src/test/resources/proxy-key-example.html updated accordingly.

Add handshake status to output of API call GET /peers

Add/correct @ApiErrors annotations on some API calls.

Add API call POST /admin/orphan (target height as body)
to force blockchain orphaning for when node is wildly out of sync.
Added support for above to BlockChain class.

BlockGenerator now requires a minimum number of peers
before it will generate any new blocks.
See "minBlockchainPeers" in settings.

Controller now requires a minimum number of peers
before it will consider synchronizing.
See "minBlockchainPeers" in settings.

Old "minPeers" entry in settings.json no longer valid!

Networking now allows both an outbound and inbound connection
to a peer although will use the outbound connection in preference.

Networking checks peer ID of inbound connections to detect,
and resolve, peer ID clashes/theft.
2019-07-23 11:09:25 +01:00
catbref
40d6190265 API tidy up
GET /addresses/proxykey/{privkey}/{pubkey} now POST /addresses/proxykey

GET /utils/fromBase58 now GET /utils/frombase58
GET /utils/fromBase64 now GET /utils/frombase64

GET /utils/toBase58/{hex} now GET /utils/tobase58/{hex}
GET /utils/toBase64/{hex} now GET /utils/tobase64/{hex}

GET /utils/privateKey/{entropy} now POST /utils/privatekey
GET /utils/publicKey/{privateKey} now POST /utils/publickey
2019-07-23 10:42:23 +01:00
catbref
a3d4cf2900 MAJOR: Don't delete transactions when orphaning - make them unconfirmed again
Lots of edits to Transaction subclasses to change/remove 'delete'.

Corresponding extra changes to help reset some transaction fields to pre-process
state during orphaning.

Changed Block, GenesisBlock & Synchronizer to save transactions where appropriate.

Added enhanced GET_SIGNATURES_V2 network message to reduce the number of
block signatures sent over network.

Peers are now version 2 if they send a new-style build version string,
instead of using first digit from build version.
2019-07-23 10:37:37 +01:00
catbref
07e8e01865 Add check to PROXY_FORGING so that proxy public key always maps to same forger-recipient combo 2019-07-23 10:30:17 +01:00
catbref
d0b45cb696 Proxy forging share to recipient can now be zero 2019-07-23 10:29:53 +01:00
catbref
0259702df2 Fix generating X25519 shared secret.
X25519 shared secrets now match those generated by libsodium.

New tests show that shared secrets are the same using either set
of private+public key combinations.

Changed proxy private key generation from using simple SHA256
of shared secret to using SHA256(shared secret + both public keys).

Added a temporary "BouncyCastle25519" shim class to provide missing
key conversion from Ed25519 to X25519.
2019-07-23 10:29:18 +01:00
catbref
4279ad0673 Fix Javascript shared-secret & proxy forging private key code 2019-07-23 10:20:20 +01:00
catbref
748dddcc32 Add checks to API call POST /admin/forgingaccounts.
Now only accepts private keys for accounts with minting rights
or derives to known proxy forging public key.
2019-07-23 10:15:17 +01:00
catbref
7409c024f6 Include proxy-forged blocks in BlockRepository.countForgedBlocks.
As used during validity check for ENABLE_FORGING transaction.
2019-07-23 10:11:51 +01:00
catbref
ae6b41a893 Improve API call showing block forger summaries to include proxy info 2019-07-23 10:11:21 +01:00
catbref
92e60e2531 Add method to prune old peers from database 2019-07-23 10:10:21 +01:00
catbref
bf8a12d422 Delete old, basic block-explorer 2019-07-23 10:07:55 +01:00
catbref
14686e1e0d Corrected wrong Synchronization enum result 2019-07-23 10:06:16 +01:00
catbref
6a8a0f25c1 Synchronization improvements
Added a finer-grained result (enum) to synchronization to replace
stark boolean result. This allows Controller to decide whether
peer can be retried in the next round (e.g. network issue) or
cooled off for an hour (e.g. peer way too far behind)

Fixed bug with wrong UPDATE_GROUP serialized transaction length.

Added logging to BlockMessage when deserialization to help catch
future bugs.
2019-07-22 18:35:30 +01:00
catbref
1f81784bd6 Improved synchronization logging 2019-07-22 18:27:48 +01:00
catbref
c05fe58676 Add static method to extract generatorSignature from block reference 2019-07-22 18:24:45 +01:00
catbref
ce2dc9b8ad Reduce synchronization attempts from every 10s to every 60s 2019-07-22 18:20:29 +01:00
catbref
1b58d12005 Fix peer data bug where lastConnected was swapped with lastAttempted. 2019-07-22 18:20:04 +01:00
catbref
ad9b42dc5d Install initial peers when creating repository 2019-07-22 18:15:07 +01:00
catbref
6feca1f4d6 Synchronizer improvements & minor fix
Restrict synchronizer to only consider peers at most 60 blocks behind.

Synchronizer will only process a batch of 200 blocks at a time.

Improve debugging message in Peer.
2019-07-22 18:08:06 +01:00
catbref
4b02b7a14f Fix unit tests 2019-07-22 18:05:41 +01:00
catbref
ecdf8212ea Fix PROXY_FORGING transaction length issue 2019-07-22 18:03:17 +01:00
catbref
af22922025 AutoUpdate: added comment about mandatory use of OpenJDK JRE, not Java SE 2019-07-22 18:01:56 +01:00
catbref
c0ae99161b Auto-Update changes
Checking interval increased from 5 seconds to 5 minutes.
(Reduces repeated fails).

System tray icon should show message just prior to applying downloaded update.
2019-07-22 18:01:29 +01:00
catbref
6be9bf9c3c Add mnemonic phrase support to VanityGen 2019-07-22 18:00:47 +01:00
catbref
7a318c9fc7 Proxy forging improvements + account flags fixes
Proxy forging recipient no longer needs a public key on the blockchain
at the point PROXY_FORGING transaction is submitted.

Proxy forging recipient is given a last-reference, if they don't have one,
when they receive their first block rewards.

Split block fees in proxy forging scenario, using same share proportion.

100% proxy sharing is now allowed.

Fixed account flags processing for accounts in genesis block.
2019-07-22 18:00:12 +01:00
catbref
3ffcf50d7c Added TransactionParticipants index 2019-07-22 17:54:16 +01:00
catbref
88f9dd1c06 Remove old, unused r5836 HSQLDB & osgi-console.sh
Added notes/ and .mvn.classpath to .gitignore

Commit 2594d4f was:
Master branch tidy up
2019-07-22 17:46:23 +01:00
catbref
29428e9450 Add extra entries to blockchain.json, remove HttpsTest, add Vanity Gen
+ minor whitespace / comment / JAXB mods

Was commit e14381d:
working on genesis block
2019-07-22 17:05:10 +01:00
catbref
57be191814 Splash startup & sys tray 2019-07-18 18:46:18 +01:00
catbref
e5b3166df4 Improve synchronization 2019-07-18 18:40:23 +01:00
catbref
4744232a1c Don't try to sync with a peer that only has genesis block
Was 85bc70b:
new testchain timestamp + don't try to sync with a peer that only has genesis block
2019-07-18 18:36:19 +01:00
catbref
eac38d4212 new log4j2.properties
Commit was b8e5641, and commit message was:
Change API port to 9888 and P2P port to 9889 + new log4j2.properties
2019-07-18 18:31:58 +01:00
catbref
675596ed6e auto update debugging 2019-07-18 18:30:30 +01:00
catbref
52ac881db0 auto update checks download against hash in tx + checks against build timestamp 2019-07-18 18:29:58 +01:00
catbref
a49e3f7a4e auto update 2019-07-18 18:28:56 +01:00
catbref
20aa49a1f1 Another attempt at auto-update 2019-07-18 15:50:05 +01:00
catbref
63a36073ec Work on auto-update + repository path + Settings bugfixes
AutoUpdate needs separate logfiles for its process as
log4j2's rolling appender doesn't support locking.
So we create AU_LOGGER in AutoUpdate and set it up
using static { } block.

Added support for starting/querying/stopping auto-update
Windows service.

Changed Controller's public connectionUrl field to
getRepositoryUrl() public static method so it
can incorporate repositoryPath from Settings.

Controller has added support for auto-update on startup.

Fix bugs with Settings not using userPath properly.

Removed obsolete standalone binary classes:
* blockgenerator
* txhex
* v1feeder
2019-07-18 15:26:41 +01:00