All notable changes to this module will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Add trustless relay validation: available service tokens for the application
- Add HTTP relay execution logic to servicer
- Adds servicer, fisherman, and validator utility modules
- Implemented
GetIndexedTransaction
- Add some comments and rename a few functions throughout to have things be more self-explanatory
- Moved over all the business logic related to getting "signer candidates" into its own file for readability purposes
- Add a place-holder Servicer implementation
- Use mockgen and Bus for DI
- Cross-check the chains handled by a servicer using the Persistence module
- Added a utility feature list with must-have and nice-to-haves for MainNet and TestNet
- Added the E2E Feature Path Template to document, present and explain how to go about defining and scoping utility level features
- Expose
HandleTransaction
for use outside of utility - Add placeholder functions
HandleRelay()
andHandleChallenge()
- Moved
utility/types/errors.go
intoshared/core/types
and updated their usage accordingly
- Rename
TxResult
toIndexedTransaction
- Introduced testing helper to test the
UtilityModule
interface implementation - Implemented the
GetSession
function from the Utility module interface - Added a
sessionHydrator
structure used to populate a new session
- Remove utility specific
TxResult
protobuf and interface - Utilize the
TxResult
protobuf inshared/core/types
- Add wrapper functions for
GetParameter()
- Add generic governance parameter accessor functions
getParamOwner()
andgetGovParam()
- Refactor governance parameter accessor functions to use general wrapper functions
- Clean up tests
- Renamed
CreateAndApplyProposalBlock
toCreateProposalBlock
- Added
GetPrevBlockByzantineValidators
andProposalBlockNotSet
errors - Instrumented
CreateProposalBlock
andApplyBlock
with log statements - Refactored functions for block creation and application to be more readable/modular
- Added TODOs for future refactoring
- Renamed
u
touow
for consistency - Added
stateHash
validation againstproposalBlock
- Added feature flag for
stateHash
validation (for testing purposes) - Updated tests accordingly
- Updated to reflect pools address changes
- Improved logging throughout the module
- Refactored
utilityContext
intoutilityUnitOfWork
- Added
utilityUnitOfWorkFactory
to createutilityUnitOfWork
instances depending on the fact that the current node isLeader
orReplica
- Updated tests
- Fixed bug where we were not removing txs from the mempool of replicas
- Added thorough documentation in different parts of the codebase
- Replace the
Store()
function with a.store
accessor - Removed the unnecessary
getStoreAndHeight()
function - Simplified
calculateMaxAppRelays
to a temporarycalculateAppSessionTokens
implementation - Improved the readability of the
Block
lifecycle andMessage
validation - Simplified the testing utilities used
- Updated the
session
interface - Renamed
applyTx
tohydrateTx
and added documentation on its functionality - Removed
DefaultTxResult
and added documentation toTxResult
result
- Update logger value references with pointers
- Fix module test after logger refactor
- Rename ServiceNode Actor Type Name to Servicer
- Module embeds
base_modules.IntegratableModule
andbase_modules.InterruptableModule
for DRYness - Logging error if
ApplyTransaction
fails (it was completely ignored before and it was really hard to understand what was going on)
- Added a
Validatable
type for basic validation - Split business logic specific to certain actors (e.g. validator reward, app relays, message handling) into separate files
- Reduced the scope of functions and types that shouldn’t be exposed
- Upgraded the actors tests - a lot went here to help with understanding what’s going on but it’s still just a start
- Remove the
Context
struct; unnecessary abstraction - Added comments and guidance on message, transaction and signature validation
- Added
ITransaction
, an interface for theTransaction
protocol to help capture the functionality it adds to the core type - DOC: Delineate between unstaking & unbonding in a few places throughout the codebase
- BUG:
tx.Equals
was comparing the same transaction against itself (major bug) - BUG:
StakingStatus
enums in utility did not reflect the same protocol as in persistence (needs to be consolidated)
- Documentation update
- Address legacy linter errors from
golangci-lint
- Changed readme to remove $ sign from code blocks
- Changed log lines to utilize new logger module.
- Introduced
txFIFOMempool
which extends the newGenericFIFOSet
in order to replace the legacy logic - Added tests for
txFIFOMempool
- Accessing
TxMempool
via thebus
inutilityContext
- Updated
TestUtilityContext_SetPoolAmount
,TestUtilityContext_GetMessageEditStakeSignerCandidates
,TestUtilityContext_GetMessageUnpauseSignerCandidates
,TestUtilityContext_GetMessageUnstakeSignerCandidates
, andTestUtilityContext_UnstakePausedBefore
to correct misplaced expected and actual values in require.Equal.
- Remove
address []byte
argument fromInsertPool
function
- Rewrite
interface{}
toany
- Updated "test/module_test.go" to encorporate MaxConnsCount, MinConnsCount, MaxConnLifetime, MaxConnIdleTime, and HealthCheckPeriod in persistence config.
- Deprecated
GetBlocksPerSession()
in favour of the more general parameter getter functionGetParameter()
- Update unit test for
GetBlocksPerSession()
to use theGetParameter()
function
- Updated module constructor to accept a
bus
and not aruntimeMgr
anymore - Registering module with the
bus
viaRegisterModule
method
- Renamed enum names as per code-review
- Using defaults from
test_artifacts
for tests - Updated tests to reflect the above changes
- Updated to use the new centralized config and genesis handling
- Updated to use the new
Actor
struct undercoreTypes
- Updated tests and mocks
- Introduce
SetProposalBlock
and local vars to keep proposal state - Maintaining proposal block state (proposer, hash, transactions) in local context
- Introduce a general purpose
HandleMessage
method at the utility level - Move the scope of
CheckTransaction
from the context to the module level - Add an
IsEmpty
function to theMempool
- Rename
DeleteTransaction
toRemoveTransaction
in the mempool - Rename
LatestHeight
toHeight
in theutilityContext
- Add comments inside
CheckTransaction
so its functionality is clearer - Add comments and cleanup the code in
mempool.go
- Minor lifecycle changes needed to supported the implementation of
ComputeAppHash
as a replacement forGetAppHash
in #285
- Propagating the
quorumCertificate
appropriately on block commit - Removed
Latest
from getters related to retrieving the context of the proposed block
- Remove
TxResult
from the utility module interface (added in TxIndexer integration of transaction indexer (issue-#168) #302) - Combined creation and application of block in proposer lifecycle
- Added Relay Protocol interfaces and diagrams
- Added session interfaces and diagrams
- Moved
TxIndexer
package to persistence module - Added new proto structure
DefaultTxResult
- Integrated the
TxIndexer
into the lifecycle- Captured
TxResult
from each played transaction - Moved the storage of transactions to the Consensus Module
- Returned the
TxResults
in theApplyBlock()
andGetProposalTransactions()
AnteHandleMessage()
now returnssigner
ApplyTransaction()
returnsTxResult
- Captured
#235 Config and genesis handling
- Updated to use
RuntimeMgr
- Made
UtilityModule
struct unexported - Updated tests and mocks
- Removed some cross-module dependencies
- Don't ignore the exit code of
m.Run()
in the unit tests - Fixed several broken unit tests related to type casting
- Removed some unit tests (e.g.
TestUtilityContext_UnstakesPausedBefore
) that were legacy and replaced by more general ones (e.g.TestUtilityContext_UnstakePausedBefore
) - Avoid exporting unnecessary test helpers
- Remove unused
StoreBlock
function from the utility module interface
- Created
UtilityConfig
- Added
max_mempool_transaction_bytes
andmax_mempool_transactions
to the utility config to allow dynamic configuration of the mempool - Matched configuration unmarshalling pattern of other modules
- Added V0 mempool default configurations
- Regenerated build files with new mempool config
- Consolidated
UtilActorType
inutility
andutility/types
totypesUtil.ActorType
- Deprecated all code in
actor.go
and replaced with test helpers - Converted stake status to proto.enum (int32)
- Added DISCUSS items around shared code and
StakeStatus
- Removed no-op
DeleteActor
code - Improved unit test for
UnstakeActorsThatAreReady()
- Removed all usages of
fmt.Sprintf()
from the testing package - Replaced all usages of
requre.True/require.False
withrequire.Equal
unless checking a boolean - Added helper function for getting height and store for a readable and consistent
typesUtil.Error
value - Added testing.M argument to
newTestingPersistenceModule
- Moved in-function literal arguments for
newTestingPersistenceModule
to private constants - Added the address parameter to
ErrInsufficientFunds
function for easier debugging - Added unit test for
LegacyVote.ValidateBasic()
- Added
ErrUnknownActorType
to all switch statements onactorType
- Removed
import
ofconsTypes
(consensus module)
- Consolidated
TransactionHash
to call a single implementation inshared/crypto/sha3
- Extracted function calls from places where we were using the same logic
Encapsulate structures previously in shared #163
- Ensured proto structures implement shared interfaces
UtilityConfig
uses shared interfaces in order to acceptMockUtilityConfig
in test_artifacts- Moved all utilty tests from shared to tests package
- Left
TODO
for tests package still importing persistence forNewTestPersistenceModule
- This is one of the last places where cross-module importing exists
- Removed transaction fees from the transaction structure as fees will be enforced at the state level
- Removed actor specific messages (besides DoubleSign) and added actorType field to the struct
- Removed pause messages and functionality as it is out of scope for the current POS iteration
- Removed session and test-scoring as it's out of scope for the current POS iteration
- Consolidated unit test functionality for actors
- Modified pre-persistence to match persistence for Update(actor), 'amountToAdd' is now just 'amount'
- Added minimal 'proof of stake' implementation with few Pocket Specific terminologies and actors
- Structures
- Accounts
- Validators
- Fishermen
- Applications
- Servicers
- Pools
- Messages
- Stake
- Unstake
- EditStake
- Pause
- Unpause
- Send
- Structures
- Added initial governance params