Skip to content

Commit

Permalink
Bug/en 721 bugfix testnet v.0.5 (#55)
Browse files Browse the repository at this point in the history
The following corrections have been applied:
 - marshalize tx before broadcasting it
 - small changes to intercepted transaction
 - prettier base64 addresses for sender/receiver
 - node: added a test for sending a receiving a transaction + fixes
 - state: added tests for plainAddressConverter
 - interceptor: added Marshalizer() func, fixed hack
 - tests fixed, changed sk and pk to be encoded in hex format
 - removed extra requestBlockTransactions
 - updated Readme.md to contain pk/sk in hex format
 - updated genesis.json to have starttime = 0
 - fixed node to work with hex and still have consensus with one node
 - added test for requesting and resolving a header
 - made p2p private key pseudo random, 
 - eliminated hash when signing/verifying tx
 - local variables renaming in block interceptors.
 - add header in header nonce pool
 - node: added possibility to generate and broadcast bulk transactions for benchmarking purposes
 - create Empty block with non empty fields
 - fixed endless synchronization by canceling consensus round only in commit hash subround
 - integrationTests: refactored directory structure, split tests in multiple files
 - added interceptedResolverTx test
 - small change in persistence unit log error when trying to get a missing key
 - put objects instead of wrapped objects in pools
 - refactored routes for multipleTransaction generation
 - process: added sorting of transactions by nonce when generating tx block body
 - refactored routes for multipleTransaction generation
 - integrationTests: added tx block body tests (netw + mem), renamed files and tests, extracted methods as to keep tests small
 - fixed mutex on requestBlockTransactions
 - refactored routes for multipleTransaction generation
 - fixed mutex after discussions
 - integrationTests: added test for netw bulk tx send, state exec transaction when recv = send and balance should not get modified
 - process: bugfixed dropping of balance when sender = recv
 - print blockcchain on go routine in CommitBlock (process/block/process.go)
 - added some prints in createMiniBlocks (process/block/process.go)
 - node: fixed generating bulk transactions, added guards to check if output no of transactions respects required no of transactions to be generated.
 - displayed only last transaction from block to make info more readable in terminal
 - node: fixed sending signed header + tx block body after consensus rounds by calling topic.BroadcastBuff not Broadcast
 - store current and genesis header hashes for reuse
 - fix wrong previous hash on block after genesis
 - fixed ntp syncronization when requested time is not received
 - interceptor: fixed logging error that might cause code to panic.
 - fixed situation when no txs is added in mini block but method createMiniBlocks returns 1 empty miniblock which is created in the begining of the method
 - changed log level from error to debug in createMiniBlocks txs ordering
 - added print info on processBlockTransaction method
 - added print info on processBlockTransaction method
 - crypto/multisig: added mutexes when writing and reading maps of commitment hashes, commitments and sig shares
 - consensus/spos: changed to show pretty strings when commitment does not match received commitment hash
 - changed max transactions allowed in one block from 100000 to 15000 in sposConsensusWorker.go
 - fixed problem with ntp syncronization
 - remove from pool transactions with invalid nonce
 - added print info on displayLogInfo method
 - fix test for invalid transaction
 - added print info on processBlockTransaction method
 - crypto/multisig: fixed a RLock - Unlock bug
 - removed api_deprecated package
 - move checks for validity of commitments and signature shares from received commitment and signature subrounds
 - if the member in consensus is not selected in bitmap, then it needs to synchronize normally
 - changed log level from Error to Debug in getTransactionFromPool
 - added print info on processBlockTransaction method
 - added print info about remained txs in pool
 - node: creation of default data stores for headers and transactions
 - p2p: fix publishing onto pubsub using a chan, go routines for writing to that chan + a go routine that serialize objects writing by taking them one at a time from the chan
 - process/sync: minor refactoring
 - node: added 1us sleep time when generation bulk transactions
 - fixed situation when a leader could send in elastic mode a proposed block in subround Start and other nodes have not reached there in this next round because of some ntp difference in order of miliseconds. This will cause that these nodes could not participate as validators in this new round as they will init all the stuff after they will received the block proposed
 - do not add in pools already parsed objects
 - changed maxTxsInBlock to 20k and ntp sync to 1 hour
 - fixed race on spos in create empty block
 - move empty block log in create empty block
 - introduced roll back for invalid header hash received when bootstrapping
 - print hash in base64
 - added print info on processBlockTransaction method
 - fixed canceled situation in spos worker
 - gopkg.lock and toml fixed to fetch pubsub from release version v0.11.10
 - added integration test to execute 15000tx and then revert them. In node, broadcasting the consensus data object is done without copying the object (again)
 - added new error, ErrTimeOut, in process/error.go
 - repaired tests in process/block/process_test.go
 - refactored some print messages and fixed a bug in process/block/process.go when waitForTxHashes returns time out combined with calling of method VerifyStateRoot with bad parameter given (this method returns always true: bp.accounts.RootHash() is compared with the given parameter bp.accounts.RootHash())
 - introduced a sleep time of 0.1 ms in createPubSub method from p2p/netMessagnger.go and all the things seems to work smoothly now
 - fixed broadcast of consensus data, added new methods to StartRound and Advance subrounds to ensure that the initialization job when a new round is started and the final round job when the current round is ended, will be done in any case. Introduced a sleep time of 0.1 ms in GenerateAndSendBulkTransactions method from node/node.go and all the tings seems to work smoothly now.
 - fixef the calculation of the next minute when the genesis time will start, to avoid some problem at the edge of the hour/day changing in cmd/bootnode/main.go
 - fixed a bug in chronology/chronology.go when it advance to the next round even if the whole round is canceled
 - introduced a new consensus messanger mechanism in consensus/spos/sposConsensusMessanger.go through which all the received consensus messages regardless of their order, will be kept and then executed when their time will come.
 - fixed some bugs in consensus/spos/sposConsensusWorker.go when network is busy and many consensus messages came latter and they were lost or much worse they were affect the next round state
 - fixed and improved consensus messenger mechanism in spos
 - replaced haveTime parameter with a function in process block
 - process block: added the ASCII table in log, not just printed on console
 - added print info on processBlockTransaction method
 - added a check fork mechanism
 - created Bootstraper interface
 - injected boostraper to sposworker
 - check in start round if node is on fork
 - storage: LRUCache changed Put func to add or rewrite the data stored in the "key" location.
 - process: added tests for interceptors
 - added forkDetector instance in main and injected it in node with option
 - changed default port to 32000
 - removed ShouldSync from spos and called from process/sync/block.go
 - added some prints and fixed a bug in requestBlockTransactions (before fixed it was returning the len of shards and not of txs requested from network) from process/block/process.go
 - added some prints and check fork in ShouldSync method
 - implemented a new fork detector class
 - removed useless function and function called from validateHeader in process/block/process.go
 - added header in returns parameter to SyncBlock to can handle in ForkChoice a roll back case of an signed block
 - added some print info in sync and node
 - fixed some print messages when received header is nil
 - fixed reverting state on consensus round when in sync
 - used time stamp round in header time stamp and not relative time
 - added mechanism of creating a check point from which roll back should not happen (when the node will commit a block signed, all the past blocks stored in forkDetecor will be removed)
 - process: improved code coverage in process package, minor refactoring, removed some mocks.
 - chronology: refactor and added tests, typos fixed
 - api: added test on transaction routes
 - chronology: added one function which returns time stamp of one given round (this will help to avoid to take into consideration some old blocks which could arrive from network)
 - chronology: added some tests
 - consensus/spos: added sync mock and some other functionalities to multi sig mock
 - refactored spos package and added missing tests
 - fixed bug in consensus/spos where maxBlockProcessingTimePercent const should be of type float and not int
 - refactored node and facade
 - changed number of transactions in block to 16000 and commented out nonce checking
 - rollback to genesis should not set blockchain currentBlock flags
 - typo efficency -> efficiency
 - max txs 16000 -> 15000
 - process/block: modified prints in header display and block display
 - process/block: fix sorting of tx by nonce, added test
 - sync/block: headers do not get erased from storage in any circumstances
 - process/block: skipped 2 tests for temporary fix by not erasing headers from storer when rollback
 - integrationTests: fixed skiped integration tests that use interceptors and resolvers
 - fixed typo from sigantures -> signatures
 - process/block/process.go: added some prints, added haveTime() function inside the loop in createMiniBlocks method, added another method to return unsorted txs
 - cmd/bbotnode/main.go: changed the genesis time to start after 1 minute
 - minor naming changes
 - changed from big.Int to *big.Int
 - minor code refactoring
 - pulled errors in variables for reuse
 - changed mutex logic inside interceptor/resolver containers and some typo fixes
 - add headline function to logger for pretty print purposes
 - fixed transaction capnproto unmarshal error
 - shardedData changed search func
 - errors are now exported in node package
 - minor code refactoring in p2p, node, main
 - added test for the modification when checking transaction signing in interceptedTransaction.
 - added test if the increaseNonce fails in transaction processor
  • Loading branch information
iulianpascalau authored Feb 5, 2019
1 parent 79946e7 commit a51aa0c
Showing 164 changed files with 15,198 additions and 5,088 deletions.
106 changes: 4 additions & 102 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
@@ -110,8 +110,8 @@
version = "1.0.0"

[[constraint]]
branch = "master"
name = "github.com/libp2p/go-libp2p-pubsub"
version = "0.11.10"

[[constraint]]
name = "github.com/libp2p/go-libp2p-secio"
92 changes: 46 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -28,53 +28,53 @@ With the text below could be created a start.sh file in the same
# Private keys:
# 1: ZBis8aK5I66x1hwD+fE8sIw2nwQR5EBlTM8EiAOLZwE=
# 2: unkVM1J1JvlNFqY3uo/CvAay6BsIL3IzDH9GDgmfUAA=
# 3: Or0C7+gvlr/kIZLS+tiBBQfbUQ+pqS9FTE3dXfs5Swg=
# 4: 0i3nK1VRtHEGKXkejwcU9JYfbtO/WwvapxF8qLfX/Ag=
# 5: lKUBBHFuqwbKLy4xJshK8I/WND3JcaHZ+P1Pk9W8YAg=
# 6: jSNFvjEnds2JvB9v74l5oBbsCsFZNxuvkwjUh1m+xQw=
# 7: HbfcRATSr697pGqawbQIllutzK1ChTUGB+BD+ZpOPAs=
# 8: p57gu5OHtDRIWmgwNqm0k77XIi73KUywHAJfuAExtwk=
# 9: QhNuOhB7/9MymO9izhC43x5aiwI4NPSfjfeSxfj8BwY=
# 10: 5WCLn8HHsEvu0NE51dPCuLPVfssd005Y4trYshr6sAc=
# 11: te4x8jjWXIyjLB77zRgcmNR4NBpZXkeVVcpGKoRo/wo=
# 12: BEBCSKoB2gBUj0+AZvs9sxFIe0rMkxRrNFNHt/fg7gk=
# 13: dE+/RIIP+UFC9RX+rAmwosjrjBIO16q07dqvCvp44ww=
# 14: T9KhsEpTlNEmpNbh8KJkIwFufYKnwxHoj8Si+Hf2ww4=
# 15: JaTuf9jrXhsGnVmWWxOFaa4IZG8bqGwp/RnZ2QV9nww=
# 16: rN4LSVhJQ4sfvgTilJ0yozErT0NEI3/TUZZVPzhYrAo=
# 17: UoazF8yMgjPQwJ4jYkw4hwjhmTOFMBXXUhLEOBQ/1Ak=
# 18: RLs0DJOwwxAX+yMA3Vyu3MRtPA/CTClKovMNfVsl9QA=
# 19: FYXMafB0++EsBK2F1X5dpdmNvau6l72jrJnH9zcYOAE=
# 20: //Cq4pEA6SW6NZeJtq4xzK/5JuZlblFbeyAPpl5/KgU=
# 21: fJFUv3dbGZuupDnTc22q5XRXCNLl1lEmmStyrguXwg0=
# 1: b5671723b8c64b16b3d4f5a2db9a2e3b61426e87c945b5453279f0701a10c70f
# 2: 8c7e9c79206f2bf7425050dc14d9b220596cee91c09bcbdd1579297572b63109
# 3: 52964f3887b72ea0bd385ee3b60d2321034256d17cb4eec8333d4a4ce1692b08
# 4: 2c5a2b1d724c21be3aebf46dfa1db841b8b58d063066c19e983ff03b3f955f08
# 5: 6532ccdb32e95ca3f4e5fc5b43c41dda610a469f7f18c76c278b9b559779300a
# 6: 772f371cafb44da6ade4af11c5799bd1c25bbdfb17335f4fc102a81b2d66cc04
# 7: 12ffff943b39b21f1c5f1455e06a2ab60d442ff9cb65451334551a0e84049409
# 8: a7160d033389e99198331a4c9e3c7417722ecc29246f42049335e972e4df5b0f
# 9: 9cf7b345fdf3c6d2de2d6b28cc0019c02966ef88774069d530b636f760292c00
# 10: f236b2f60ad8864ea89fd69bf74ec65f64bd82c2f310b81a8492ba93e8b6c402
# 11: 0f04b269d382944c5c246264816567c9a33b2a9bf78f075d9a17b13e7b925603
# 12: 8cf6e6aeb878ef01399e413bc7dd788a69221a37c29021bd3851f2f5fe67f203
# 13: c7f48a69e4b2159fe209bdb4608410516f28186ad498ca78b16d8b2bebfb1f0f
# 14: 7579d506ff015e5e720b2e75e784c13a4662f48b6e2038af6e902b1157239101
# 15: b7877c28e394ab4c89d80e8b2818ef1346ee8c0fdd6566a6d27088ad097e4f05
# 16: 055ae06aad2c7f8d50ecd4bd7c4145cb19636b0b0126ffa4ee1326afb3876000
# 17: c47b89db3e3ad067863af5a7b7f9e9dec0e47516e87d5d6d744e0af581a79404
# 18: 843c4bea60b629fae50a0334ba9c7284f886b90502b740c8f95ab13a36a08c0e
# 19: 92561fd546014adcd13ff7776829f1c8c0886e83eb04fb723fc3636da8f2960b
# 20: 22a3922963cc1fe57a59178f021282223a8742fb4476f7a5c5b4c2c2aa2d4f0f
# 21: 02c9d56e503857832c07d78b0d75aabb8e6c109e9cec641b8681afaee2c9a701
# Public keys:
# 1: bCYAUf+qhQtYKFfgQ1g3JstkJFVTsA2KAH+0L+qZlO4=
# 2: gDI39ZN3loP1Cujru6+BJtu+gNwQnBB8g4yVW0wyuaA=
# 3: TLkPlhd8g07tiqE4Mgvq1kCp3EOEEjn8O3/DpyjUqFE=
# 4: YO0S6tNhNjWwsJJzTLrJMecEKDLeuZlJNznf7nU/TcM=
# 5: Gkfqv+PTR9ot2TILrOBFcPojmhwE9IC7Y2psLc9ZsZc=
# 6: nVnGbEbxPR4ab0thyeV/O1FZopNDTdNexNI5OPCGtRo=
# 7: xMonbskDZ1dHeW4vh3/AUzf7psbPIPTKfGz+J6gmpeA=
# 8: 6kVjlTw6NmSqV4kI6cEprxd+2f37FXCzpXnFsYYcsLU=
# 9: 0NNr5LuHjgSSiXFKp37uPAjGt1HYdQJTUmJ4ASKGZyQ=
# 10: JyK0pKNF3UnzIFtm9pVDXF3xArpfhrU4g2bbGxwHBwE=
# 11: bT4UtBU3A5MpKWvvpL5nAplLAGEWccoJb9NzdXJN1fk=
# 12: S+goExeC5GNLPx9xYnhXB8mVQQzGJpr0B1QCU/DqqdM=
# 13: 1KGnod6xGDML+y5qNiwrYq2t2M1Elgbt2YNfXLRSow0=
# 14: 84uQq3tJFjzSZ6KIcJwb7JZ1yLwuDytcPHYITVlnNjA=
# 15: 8pqG75sKgeqIKim2jR/P7ojM5QgSQkHLt6xpablZoM0=
# 16: E8u9qxcr8hQ3nM6RfOOLS4bzu9fV+whiTtOY5kjaDlE=
# 17: M+C7UJoK6poGvlPqkLVpFOuWao9dFtCoHVWaWv0ee3U=
# 18: NBu1klLKrye76DblD8IhexsHrai2TD4+8KdWBWWqaxc=
# 19: SBoD6sJA5oEmyhwK5CckOlH3ByrJkyJZyih+iy1tGno=
# 20: NUhC12eqQ0U5IIjpytuaWzBSSPYE2myNVro8I/3Rjpg=
# 21: +cmFvcxUN9roSQnW8AMpi3kq0LDSTZCIrL8f7Pc6ez4=
# 1: 5126b6505a73e59a994caa8f556f8c335d4399229de42102bb4814ca261c7419
# 2: 8e0b815be8026a6732eea132e113913c12e2f5b19f25e86a8403afffbaf02088
# 3: e6ec171959063bd0d61f95a52de73d6a16e649ba5fa8b12663b092b48cc99434
# 4: 20ccf92c80065a0f9ce1f1b8e3dee1e0b9774f4eebf2af7e8fa3ac503923360d
# 5: 9a3b8e67f42aef9544e0888ea9daee77af90292c86336203d224691d55306d08
# 6: 0740bccedc28084ab811065cb618fec4ee623384b4b3d5466190d11ff6d77007
# 7: 0ccba0f98829ea9f337035a1f7b13cbd8e9ffb94f2c538e2cafb34ca7f2bcd24
# 8: d9e9596c28a3945253d46bc1b9418963c0672a26a0b40ee7372cb9ec34d1ee07
# 9: 86fbd8606e73b7a4f45a51b443270f3050aff571a29b9804d2444c081560d1dd
# 10: 2084f2493e68443a5b156ec42a8cd9072c47aa453df4acd20524792a4fd9f474
# 11: f91d24256d918144aaacfa641cd113af05d56cfb7a5b8ba5885ebd8edd43fe1e
# 12: e8d4bcfe91c3c7788d8ab3704b192229900ec3fe3f1eb6f841c440e223d401a0
# 13: 4bf7ee0e17a0b76d3837494d3950113d3e77db055b2c07c9cb443f529d73c8e3
# 14: 20f12f7bdd4ab65321eb58ce8f90eec733e3e9a4cc9d6d5d7e57d2e86c6c2c76
# 15: 34cf226f4d62a22e4993a1a2835f05a4bb2fb48304e16f2dc18f99b39c496f7d
# 16: b9f0fc3e1baa49c027205946af7d6c79b749481e5ab766356db3b878c0929558
# 17: 6670b048a3f9d93fdacb4d60ff7c2f3bd7440d5175ca8b9d2475a444cd7a129b
# 18: d82b3f4490ccb2ffbba5695c1b7c345a5709584737a263999c77cc1a09136de1
# 19: 29ba49f47e2b86b143418db31c696791215236925802ea1f219780e360a8209e
# 20: 199866d09b8385023c25f261460d4d20ae0d5bc72ddf1fa5c1b32768167a8fb0
# 21: 0098f7634d7327139848a0f6ad926051596e5a0f692adfb671ab02092b77181d
gnome-terminal -- ./bootnode -port 4000 -max-allowed-peers 4 -private-key "ZBis8aK5I66x1hwD+fE8sIw2nwQR5EBlTM8EiAOLZwE="
gnome-terminal -- ./bootnode -port 4001 -max-allowed-peers 4 -private-key "unkVM1J1JvlNFqY3uo/CvAay6BsIL3IzDH9GDgmfUAA="
gnome-terminal -- ./bootnode -port 4002 -max-allowed-peers 4 -private-key "Or0C7+gvlr/kIZLS+tiBBQfbUQ+pqS9FTE3dXfs5Swg="
```
gnome-terminal -- ./bootnode -port 4000 -max-allowed-peers 4 -private-key "b5671723b8c64b16b3d4f5a2db9a2e3b61426e87c945b5453279f0701a10c70f"
gnome-terminal -- ./bootnode -port 4001 -max-allowed-peers 4 -private-key "8c7e9c79206f2bf7425050dc14d9b220596cee91c09bcbdd1579297572b63109"
gnome-terminal -- ./bootnode -port 4002 -max-allowed-peers 4 -private-key "52964f3887b72ea0bd385ee3b60d2321034256d17cb4eec8333d4a4ce1692b08"
```
13 changes: 12 additions & 1 deletion api/address/mock/facade.go
Original file line number Diff line number Diff line change
@@ -2,15 +2,26 @@ package mock

import (
"math/big"

"github.com/ElrondNetwork/elrond-go-sandbox/data/state"
)

// Facade is the mock implementation of a address router handler
type Facade struct {
BalanceHandler func(string) (*big.Int, error)
BalanceHandler func(string) (*big.Int, error)
GetAccountHandler func(address string) (*state.Account, error)
}

// GetBalance is the mock implementation of a handler's GetBalance method
func (f *Facade) GetBalance(address string) (*big.Int, error) {
return f.BalanceHandler(address)
}

// GetAccount is the mock implementation of a handler's GetAccount method
func (f *Facade) GetAccount(address string) (*state.Account, error) {
return f.GetAccountHandler(address)
}

// WrongFacade is a struct that can be used as a wrong implementation of the address router handler
type WrongFacade struct {
}
Loading

0 comments on commit a51aa0c

Please sign in to comment.