[peermgr]
- Add request cache with tests
- Add requestCache to peermgr
- refactored peer manager tests
- Added blockInfo struct, to allow sorting on the blockIndex
- added helper methods for cache, pickItem, pickFirstItem, removeHash,
findHash and refactored tests
- renamed requestcache to blockcache
- refactored peer manager to use block cache for block requests *only*
- added blockCallPeer function to handle block requests only
- refactored onDisconnect to add back any pending peer requests that the
disconnected peer did not complete into the peer manager queue
[peermgr/server]
- Modify onBlock handler in server, to send peermgr a BlockInfo struct
[peermgr/syncmgr/server]
- Modified blockIndex in BlockInfo to be uint32 and not uint64
- RequestBlocks in syncmgr now takes an index along with the hash
- modified syncmgr code to pass index along with hash in all methods
* [syncmgr]
- Add blockmode, normal mode, headermode
- Add config file
- Add test files
- removed RequestBlocks and RequestHeaders from peers, as we will use
the peermanager for this
- OnHeaders and OnBlock in syncmgr, now return errors
- refactored all tests to use a convenience method to return a syncmgr
and testHelper
* [chain]
- Add basic chain cfg parameters
- Added logic to insert genesis block, if it is a fresh database
- changed SaveBlock to ProcessBlock
- changed SaveHeaders to ProcessHeaders
- Changed parameter from a wire message to the payload, for header and
block processing
- Added check in chain for when the block is in the future, i.e. not at
the tip of the chain
- Added custom error returns, to distinguish between a database error
and a validation error
[Peer]
- Closes#239
- moved response handlers to their own functions
- removed DefaultConfig from LocalConfig file
- passed peer as a parameter to all response handlers
- added peer start height
- refactored NewPeer function to be more concise and clear
- removed empty lines at end of functions
- Added AddMessage/RemoveMessage for Detector in outgoing and ingoing
requests for Block and Headers
* [database]
- Add Prefix method to interface
- Convert leveldb error to `database error`
- Be explicit with prefixedKey in `Table` as slices can be pointers
* [protocol]
- Add stringer method to protocol
* [Chaindb]
- Added saveBlock() which will allow us to save a block into the
database. The block is broken up into transactions and Headers. The
headers are saved as is. The transactions are saved as is, then the
utxos in the transactions are collected to make the utxo db.
- Verification for blocks and transactions will reside in the same
package. Note that the save methods are all unexported, while the Get
methods are exported. Making it so that any can call a get method, but
only code in this package may save to the database. The other code which
will reside in this package will be code verification logic.
* [chaindb]
- Added saveHeader function which saveHeaders uses
- Update the latest header, each time we save a header instead of after a batch. This is so that we can call saveHeader without saveHeaders. This functionality can be rolled back if the performance of updating the header after a batch is significant
- small refactor in test code
* Added new config attributes: 'SecondsPerBlock','LowPriorityThreshold'
* Added new files:
* Added new method: CompareTo
* Fixed empty Slice case
* Added new methods: LessThan, GreaterThan, Equal, CompareTo
* Added new method: InputIntersection
* Added MaxTransactionSize, GroupOutputByAssetID
* Added ned method: ScriptHash
* Added new method: IsDoubleSpend
* Refactor blockchainer, Added Feer interface, Verify and GetMemPool method
* 1) Added MemPool
2) Added new methods to satisfy the blockchainer interface: IsLowPriority, Verify, GetMemPool
* Added new methods: RelayTxn, RelayDirectly
* Fixed tests
* Implemented RPC server method sendrawtransaction
* Refactor getrawtransaction, sendrawtransaction in separate methods
* Moved 'secondsPerBlock' to config file
* Implemented Kim suggestions:
1) Fixed data race issues
2) refactor Verify method
3) Get rid of unused InputIntersection method due to refactoring Verify method
4) Fixed bug in https://github.com/CityOfZion/neo-go/pull/174#discussion_r264108135
5) minor simplications of the code
* Fixed minor issues related to
1) space
2) getter methods do not need pointer on the receiver
3) error message
4) refactoring CompareTo method in uint256.go
* Fixed small issues
* Use sync.RWMutex instead of sync.Mutex
* Refined (R)Lock/(R)Unlock
* return error instead of bool in Verify methods
* VM:Add abstract stack item
* VM: Add stackItems; Array, Boolean, Int and ByteArray
* VM: Add tests for stack item
* VM: first pass at Random Access Stack object
* VM: Add Sub, Mul, Mod LSH, RSH
* VM: moved test helper functions into separate file
* VM: removed helper functions from stack_test.go
* Add conversions for bytearray and Int stack items
* Add instructions file for vm
* - Add guide to stack readme
- Add testReadInt64
* Add Builder
* Refactor Int, Boolean, ByteArray conversion
* Add Context stack Item
* Add Invocation stack - convenience RAS
* rename testhelper to test_helper
* Move opcode file
* - Add `Add` OpCode
- Add Opcode Function map
* - Add test for math `Add` opcode
- basic opcode execution
* Add popTwoIntegers convenience func
* Add `SUB` Opcode
* Export Context Read methods
- Return errors where failable
* - Add `Op` to handleOP func signature
- Add PushNBytes OPcode
* remove error on NewBoolean
- Expose underlying with Getter on Boolean StackItem
- Add Equals method for ByteArray
* Make Next() method on Context failable, refactor peekContext and Peek
* Add ExecuteOp, Step and Run methods on the VM
* Add Equal Opcode
* Add THROWIFNOT Opcode
* Add RET Opcode
* Refactor PushNBytes Opcode
* refactor Add, Sub to return VMSTATE
add popTwoByteArrays helper function
* Add basic tests for vm
* clarify vm states
* Add astack
* [VM]
Pass ResultStack to the opcode handlers
* [VM]
refactor handlers to have rstack as argument
* [Stack]
- Change RemoveCurrentContext for PopCurrentContext
- Add CopTo method to stack
* [VM]
Add Result stack Len check in simple run test
* [VM] fix typo
* [Peer/Stall]
Change seconds to milliseconds in test