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

[Utility] Session Interface - GetSession Implementation (1st iteration) #683

Merged
merged 58 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c473aea
session.proto added - good starting point
Olshansk Apr 11, 2023
c0f7269
Got session to almost generate
Olshansk Apr 11, 2023
11353f7
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 12, 2023
363f4ac
Snapshot before changing how we manage chains
Olshansk Apr 12, 2023
fc0f1f5
Added fisherman_per_session_owner
Olshansk Apr 12, 2023
7eff6f1
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 12, 2023
74f11be
All unit tests pasing again
Olshansk Apr 13, 2023
4f4cbbc
Added TestSession_SessionHeight
Olshansk Apr 13, 2023
4b096bf
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 13, 2023
0bf2d75
Remove read ctx
Olshansk Apr 13, 2023
6c04122
Refactor some tests
Olshansk Apr 14, 2023
c913c6d
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 14, 2023
bfceded
Added a test validating num of servicers and fisherman is correct
Olshansk Apr 15, 2023
96fe1a2
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 17, 2023
2eb3c62
Unit tests passing before adding more complex ones
Olshansk Apr 17, 2023
42c59ec
Finished TestSession_GetSession_ServicersAndFishermenCounts_ChainAvai…
Olshansk Apr 17, 2023
ee5b3f4
Finished TestSession_GetSession_InvalidFutureSession
Olshansk Apr 18, 2023
50ccff3
Add tests for TestSession_GetSession_ServicersAndFishermanEntropy
Olshansk Apr 18, 2023
830c72a
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 18, 2023
88a36b7
Changed getSessionHeight to hydrateSessionHeight
Olshansk Apr 18, 2023
99b25a3
Updated DefaultNumBlockPerSession=1 and tests passing again
Olshansk Apr 18, 2023
23f74dd
Self review
Olshansk Apr 19, 2023
3fa7ac3
Added some session application validation checks
Olshansk Apr 19, 2023
cc15ba1
Fix one of the broken tests
Olshansk Apr 19, 2023
42bc9f6
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 20, 2023
ede4821
Replied to all comments
Olshansk Apr 20, 2023
4caac93
Code and documentation cleanup
Olshansk Apr 21, 2023
c723b33
Fix broken test
Olshansk Apr 21, 2023
e108e03
Merge with main
Olshansk Apr 21, 2023
32bf680
Checkpoint - replied to some of Bryan's comments
Olshansk Apr 21, 2023
8688645
Consolidated MarshalZerologArray() in logger/utils.go
Olshansk Apr 21, 2023
7df6c88
Replied to remaining review comments
Olshansk Apr 21, 2023
50d0c71
Merge branch 'main' into issues/569/session_impl
Olshansk Apr 24, 2023
424cd54
Update utility/session.go
Olshansk Apr 26, 2023
6c4d3ce
Apply suggestions from code review
Olshansk Apr 26, 2023
6f26138
Update utility/session_test.go
Olshansk Apr 27, 2023
547d4b2
[Makefile] fixes the localnet_db_cli target (#700)
dylanlott Apr 24, 2023
f3a545e
[E2E] adds in-cluster config for E2E tests (#689)
dylanlott Apr 24, 2023
efba9a6
[Docs] Update shared module creation (#693)
bryanchriswhite Apr 25, 2023
673fccb
s/actorsToAdds/actorsToAddrs
Olshansk Apr 26, 2023
565f0b7
Updated logger README
Olshansk Apr 26, 2023
5f072f2
Add clarifying comments
Olshansk Apr 27, 2023
aebd770
Reply to comments
Olshansk Apr 27, 2023
664abf7
Update TECHDEBT ticket
Olshansk Apr 27, 2023
4607f7e
Merge with main
Olshansk Apr 27, 2023
c824948
Apply demorgan's law
Olshansk Apr 27, 2023
cf2f6e0
Markdown nit
Olshansk Apr 27, 2023
d0d3463
Update Makefile
Olshansk Apr 28, 2023
2e92fd2
Update utility/session_test.go
Olshansk Apr 28, 2023
b83efc7
[P2P] chore: remove unnecessary `stdnetwork` package (#703)
bryanchriswhite Apr 28, 2023
c2e2c9a
[P2P] refactor: rename "network" to "router" (#704)
bryanchriswhite Apr 28, 2023
66a8940
MInor NIT comments
Olshansk Apr 28, 2023
e26608a
utility/module_test.go -> utility/main_test.go
Olshansk Apr 28, 2023
e4ac25e
Typo
Olshansk Apr 28, 2023
50b92e5
Fix changelogs
Olshansk Apr 28, 2023
d06787e
Update all the changelogs
Olshansk Apr 28, 2023
42d69bc
Merge with main
Olshansk Apr 28, 2023
e2864b8
Add t.Helper in session_test.go
Olshansk Apr 28, 2023
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
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,10 @@ benchmark_p2p_peerstore: ## Run P2P peerstore benchmarks

### Inspired by @goldinguy_ in this post: https://goldin.io/blog/stop-using-todo ###
# TODO - General Purpose catch-all.
# DECIDE - A TODO indicating we need to make a decision and document it using an ADR in the future; https://github.com/pokt-network/pocket-network-protocol/tree/main/ADRs
# TECHDEBT - Not a great implementation, but we need to fix it later.
# IMPROVE - A nice to have, but not a priority. It's okay if we never get to this.
# OPTIMIZE - An opportunity for performance improvement if/when it's necessary
# DISCUSS - Probably requires a lengthy offline discussion to understand next steps.
# INCOMPLETE - A change which was out of scope of a specific PR but needed to be documented.
# INVESTIGATE - TBD what was going on, but needed to continue moving and not get distracted.
Expand All @@ -453,7 +455,7 @@ benchmark_p2p_peerstore: ## Run P2P peerstore benchmarks
# BUG - There is a known existing bug in this code
# DISCUSS_IN_THIS_COMMIT - SHOULD NEVER BE COMMITTED TO MASTER. It is a way for the reviewer of a PR to start / reply to a discussion.
# TODO_IN_THIS_COMMIT - SHOULD NEVER BE COMMITTED TO MASTER. It is a way to start the review process while non-critical changes are still in progress
TODO_KEYWORDS = -e "TODO" -e "TECHDEBT" -e "IMPROVE" -e "DISCUSS" -e "INCOMPLETE" -e "INVESTIGATE" -e "CLEANUP" -e "HACK" -e "REFACTOR" -e "CONSIDERATION" -e "TODO_IN_THIS_COMMIT" -e "DISCUSS_IN_THIS_COMMIT" -e "CONSOLIDATE" -e "DEPRECATE" -e "ADDTEST" -e "RESEARCH" -e "BUG"
TODO_KEYWORDS = -e "TODO" -e "DECIDE" -e "TECHDEBT" -e "IMPROVE" -e "OPTIMIZE" -e "DISCUSS" -e "INCOMPLETE" -e "INVESTIGATE" -e "CLEANUP" -e "HACK" -e "REFACTOR" -e "CONSIDERATION" -e "TODO_IN_THIS_COMMIT" -e "DISCUSS_IN_THIS_COMMIT" -e "CONSOLIDATE" -e "DEPRECATE" -e "ADDTEST" -e "RESEARCH" -e "BUG"

# How do I use TODOs?
# 1. <KEYWORD>: <Description of follow up work>;
Expand All @@ -470,6 +472,13 @@ TODO_KEYWORDS = -e "TODO" -e "TECHDEBT" -e "IMPROVE" -e "DISCUSS" -e "INCOMPLETE
todo_list: ## List all the TODOs in the project (excludes vendor and prototype directories)
grep --exclude-dir={.git,vendor,prototype} -r ${TODO_KEYWORDS} .


TODO_SEARCH ?= $(shell pwd)

.PHONY: todo_search
todo_search: ## List all the TODOs in a specific directory specific by `TODO_SEARCH`
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
grep --exclude-dir={.git,vendor,prototype} -r ${TODO_KEYWORDS} ${TODO_SEARCH}

.PHONY: todo_count
todo_count: ## Print a count of all the TODOs in the project
grep --exclude-dir={.git,vendor,prototype} -r ${TODO_KEYWORDS} . | wc -l
Expand Down
4 changes: 3 additions & 1 deletion build/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4120,7 +4120,7 @@
}
],
"params": {
"blocks_per_session": 4,
"blocks_per_session": 1,
"app_minimum_stake": "15000000000",
"app_max_chains": 15,
"app_session_tokens_multiplier": 100,
Expand All @@ -4138,6 +4138,7 @@
"fisherman_unstaking_blocks": 2016,
"fisherman_minimum_pause_blocks": 4,
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
"fisherman_max_pause_blocks": 672,
"fisherman_per_session": 1,
"validator_minimum_stake": "15000000000",
"validator_unstaking_blocks": 2016,
"validator_minimum_pause_blocks": 4,
Expand Down Expand Up @@ -4192,6 +4193,7 @@
"fisherman_unstaking_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_minimum_pause_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_max_paused_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_per_session_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_minimum_stake_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_unstaking_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_minimum_pause_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
Expand Down
2 changes: 2 additions & 0 deletions build/config/genesis_localhost.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
"fisherman_unstaking_blocks": 2016,
"fisherman_minimum_pause_blocks": 4,
"fisherman_max_pause_blocks": 672,
"fisherman_per_session": 1,
"validator_minimum_stake": "15000000000",
"validator_unstaking_blocks": 2016,
"validator_minimum_pause_blocks": 4,
Expand Down Expand Up @@ -214,6 +215,7 @@
"fisherman_unstaking_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_minimum_pause_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_max_paused_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_per_session_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_minimum_stake_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_unstaking_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_minimum_pause_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
Expand Down
5 changes: 5 additions & 0 deletions build/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.0.38] - 2023-04-28

- Added a `fisherman_per_session` governance parameter
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
- Updated the default `blocks_per_session` from `4` to `1`
Olshansk marked this conversation as resolved.
Show resolved Hide resolved

## [0.0.0.37] - 2023-04-24

- Adds kubectl to dev Dockerfile image
Expand Down
4 changes: 3 additions & 1 deletion build/localnet/manifests/configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4124,7 +4124,7 @@ data:
}
],
"params": {
"blocks_per_session": 4,
"blocks_per_session": 1,
"app_minimum_stake": "15000000000",
"app_max_chains": 15,
"app_session_tokens_multiplier": 100,
Expand All @@ -4142,6 +4142,7 @@ data:
"fisherman_unstaking_blocks": 2016,
"fisherman_minimum_pause_blocks": 4,
"fisherman_max_pause_blocks": 672,
"fisherman_per_session": 1,
"validator_minimum_stake": "15000000000",
"validator_unstaking_blocks": 2016,
"validator_minimum_pause_blocks": 4,
Expand Down Expand Up @@ -4196,6 +4197,7 @@ data:
"fisherman_unstaking_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_minimum_pause_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_max_paused_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"fisherman_per_session_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_minimum_stake_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_unstaking_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
"validator_minimum_pause_blocks_owner": "da034209758b78eaea06dd99c07909ab54c99b45",
Expand Down
19 changes: 19 additions & 0 deletions logger/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Global Logging](#global-logging)
- [Module Logging](#module-logging)
- [Logger Initialization](#logger-initialization)
- [Submodule / Subcontext Logging](#submodule--subcontext-logging)
- [Accessing Logs](#accessing-logs)
- [Grafana](#grafana)
- [Example Queries](#example-queries)
Expand Down Expand Up @@ -128,6 +129,24 @@ func (m *sweetModule) Start() error {
}
```

## Submodule / Subcontext Logging
Olshansk marked this conversation as resolved.
Show resolved Hide resolved

A common helpful practice is to create a logger that can be easily filtered for within a specific context, such as a specific submodule, a function or a code path.

```golang
m.logger.With().Str("source", "contextName").Logger(),
```

For example:

```golang

func (m *Module) fooFunc() {
fooLogger := m.logger.With().Str("source", "fooFunc").Logger(),
// use fooLogger here
}
```

## Accessing Logs

Logs are written to stdout. In LocalNet, Loki is used to capture log output. Logs can then be queried using [LogQL](https://grafana.com/docs/loki/latest/logql/) syntax. Grafana can be used to visualize the logs.
Expand Down
17 changes: 17 additions & 0 deletions logger/utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package logger

import "github.com/rs/zerolog"

// stringLogArrayMarshaler implements the `zerolog.LogArrayMarshaler` interface
// to marshal an array of strings for use with zerolog.
type StringLogArrayMarshaler struct {
Strings []string
}

// MarshalZerologArray implements the respective `zerolog.LogArrayMarshaler`
// interface member.
func (marshaler StringLogArrayMarshaler) MarshalZerologArray(arr *zerolog.Array) {
for _, str := range marshaler.Strings {
arr.Str(str)
}
}
18 changes: 1 addition & 17 deletions p2p/utils/url_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/multiformats/go-multiaddr"
"github.com/pokt-network/pocket/logger"
"github.com/rs/zerolog"
)

const (
Expand Down Expand Up @@ -183,23 +182,8 @@ func getPeerIP(hostname string) (net.IP, error) {
logger.Global.Warn().Msg("resolved multiple addresses but only using one. See ticket #557 for more details")
logger.Global.Warn().
Str("hostname", hostname).
Array("resolved", stringLogArrayMarshaler{strs: addrs}).
Array("resolved", logger.StringLogArrayMarshaler{Strings: addrs}).
IPAddr("using", peerIP)

return peerIP, nil
}

// stringLogArrayMarshaler implements the `zerolog.LogArrayMarshaler` interface
// to marshal an array of strings for use with zerolog.
// TECHDEBT(#609): move & de-duplicate
type stringLogArrayMarshaler struct {
strs []string
}

// MarshalZerologArray implements the respective `zerolog.LogArrayMarshaler`
// interface member.
func (marshaler stringLogArrayMarshaler) MarshalZerologArray(arr *zerolog.Array) {
for _, str := range marshaler.strs {
arr.Str(str)
}
}
21 changes: 20 additions & 1 deletion persistence/actor.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
package persistence

import (
"fmt"

"github.com/pokt-network/pocket/persistence/types"
coreTypes "github.com/pokt-network/pocket/shared/core/types"
)

func (p *PostgresContext) GetActor(actorType coreTypes.ActorType, address []byte, height int64) (*coreTypes.Actor, error) {
var schema types.ProtocolActorSchema
switch actorType {
case types.ApplicationActor.GetActorType():
schema = types.ApplicationActor
case types.ServicerActor.GetActorType():
schema = types.ServicerActor
case types.FishermanActor.GetActorType():
schema = types.FishermanActor
case types.ValidatorActor.GetActorType():
schema = types.FishermanActor
default:
return nil, fmt.Errorf("invalid actor type: %s", actorType)
}
return p.getActor(schema, address, height)
}

// TODO (#399): All of the functions below following a structure similar to `GetAll<Actor>`
// can easily be refactored and condensed into a single function using a generic type or a common
// interface.
Expand Down Expand Up @@ -113,7 +132,7 @@ func (p *PostgresContext) GetAllFishermen(height int64) (f []*coreTypes.Actor, e
return
}

// IMPROVE: This is a proof of concept. Ideally we should have a single query that returns all actors.
// OPTIMIZE: There is an opportunity to have one SQL query returning all the actorsp
func (p *PostgresContext) GetAllStakedActors(height int64) (allActors []*coreTypes.Actor, err error) {
type actorGetter func(height int64) ([]*coreTypes.Actor, error)
actorGetters := []actorGetter{p.GetAllValidators, p.GetAllServicers, p.GetAllFishermen, p.GetAllApps}
Expand Down
6 changes: 6 additions & 0 deletions persistence/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.0.50] - 2023-04-28

- Implemented a new `GetActor` persistence modular functoin
- Added `fisherman_per_session` parameter
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
- Minor code and comment cleanup

## [0.0.0.49] - 2023-04-14

- Index transactions in the `TxIndexer` by sender and recipient using the height and block index of the transactions
Expand Down
19 changes: 8 additions & 11 deletions persistence/test/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
)

func TestPersistenceContextParallelReadWrite(t *testing.T) {
prepareAndCleanContext(t)
clearAllState()
t.Cleanup(clearAllState)

// variables for testing
_, _, poolAddr := keygen.GetInstance().Next()
Expand Down Expand Up @@ -57,7 +58,8 @@ func TestPersistenceContextParallelReadWrite(t *testing.T) {
}

func TestPersistenceContextTwoWritesErrors(t *testing.T) {
prepareAndCleanContext(t)
clearAllState()
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
t.Cleanup(clearAllState)

// Opening up first write context succeeds
rwCtx1, err := testPersistenceMod.NewRWContext(0)
Expand All @@ -74,7 +76,8 @@ func TestPersistenceContextTwoWritesErrors(t *testing.T) {
}

func TestPersistenceContextSequentialWrites(t *testing.T) {
prepareAndCleanContext(t)
clearAllState()
t.Cleanup(clearAllState)

// Opening up first write context succeeds
writeContext1, err := testPersistenceMod.NewRWContext(0)
Expand All @@ -93,7 +96,8 @@ func TestPersistenceContextSequentialWrites(t *testing.T) {
}

func TestPersistenceContextMultipleParallelReads(t *testing.T) {
prepareAndCleanContext(t)
clearAllState()
t.Cleanup(clearAllState)

// Opening up first read context succeeds
readContext1, err := testPersistenceMod.NewReadContext(0)
Expand All @@ -111,10 +115,3 @@ func TestPersistenceContextMultipleParallelReads(t *testing.T) {
readContext2.Release()
readContext3.Release()
}

func prepareAndCleanContext(t *testing.T) {
// Cleanup context after the test
t.Cleanup(clearAllState)

clearAllState()
}
9 changes: 6 additions & 3 deletions persistence/test/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ var (
StakeToUpdate = utils.BigIntToString((&big.Int{}).Add(DefaultStakeBig, DefaultDeltaBig))

DefaultStakeStatus = int32(coreTypes.StakeStatus_Staked)
DefaultPauseHeight = int64(-1) // pauseHeight=-1 means not paused
DefaultUnstakingHeight = int64(-1) // pauseHeight=-1 means not unstaking
DefaultPauseHeight = int64(-1) // pauseHeight=-1 implies not paused
DefaultUnstakingHeight = int64(-1) // unstakingHeight=-1 implies not unstaking
Olshansk marked this conversation as resolved.
Show resolved Hide resolved

OlshanskyURL = "https://olshansky.info"
OlshanskyChains = []string{"OLSH"}
Expand All @@ -53,8 +53,10 @@ var (
genesisStateNumServicers = 1
genesisStateNumApplications = 1
genesisStateNumFishermen = 1

// Initialized in TestMain
testPersistenceMod modules.PersistenceModule
)
var testPersistenceMod modules.PersistenceModule // initialized in TestMain

// See https://github.com/ory/dockertest as reference for the template of this code
// Postgres example can be found here: https://github.com/ory/dockertest/blob/v3/examples/PostgreSQL.md
Expand Down Expand Up @@ -360,6 +362,7 @@ func resetStateToGenesis() {
}
}

// TECHDEBT: Make sure all tests run `t.Cleanup(clearAllState)`
// This is necessary for unit tests that are dependant on a completely clear state when starting
func clearAllState() {
if err := testPersistenceMod.ReleaseWriteContext(); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions persistence/test/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func TestStateHash_DeterministicStateWhenUpdatingAppStake(t *testing.T) {
// logic changes, these hashes will need to be updated based on the test output.
// TODO: Add an explicit updateSnapshots flag to the test to make this more clear.
stateHashes := []string{
dylanlott marked this conversation as resolved.
Show resolved Hide resolved
"3a9a33c4d6b106f656c859296cd5ac16b608980d1d921f6de77051a707f48cb5",
"ec3d62106f1ca61dfe9c1d80a16c4ee3923550db5175389777bd1ecd9d50136e",
"e440914fba03bbb5ff4fbb73f760e4e75c3635263bbf7c15ca649870ee865222",
"4b5da068a4792c30a73c36d00f01af12262e9d753992f2d56d4ca64f3f2ac894",
"0565768b758981f511a71131a63710b9e43fa51095de658a1454f3b8b7895a15",
"f0796a7072c402e22abd0d2ef5c5a199aa5b6cb208824af24b58c4c777fc3284",
}

stakeAmount := initialStakeAmount
Expand Down
4 changes: 3 additions & 1 deletion persistence/types/gov_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestInsertParams(t *testing.T) {
params: test_artifacts.DefaultParams(),
height: DefaultBigInt,
},
want: "INSERT INTO params VALUES ('blocks_per_session', -1, 'BIGINT', 4)," +
want: "INSERT INTO params VALUES ('blocks_per_session', -1, 'BIGINT', 1)," +
"('app_minimum_stake', -1, 'STRING', '15000000000')," +
"('app_max_chains', -1, 'SMALLINT', 15)," +
"('app_session_tokens_multiplier', -1, 'BIGINT', 100)," +
Expand All @@ -41,6 +41,7 @@ func TestInsertParams(t *testing.T) {
"('fisherman_unstaking_blocks', -1, 'BIGINT', 2016)," +
"('fisherman_minimum_pause_blocks', -1, 'SMALLINT', 4)," +
"('fisherman_max_pause_blocks', -1, 'SMALLINT', 672)," +
"('fisherman_per_session', -1, 'SMALLINT', 1)," +
"('validator_minimum_stake', -1, 'STRING', '15000000000')," +
"('validator_unstaking_blocks', -1, 'BIGINT', 2016)," +
"('validator_minimum_pause_blocks', -1, 'SMALLINT', 4)," +
Expand Down Expand Up @@ -95,6 +96,7 @@ func TestInsertParams(t *testing.T) {
"('fisherman_unstaking_blocks_owner', -1, 'STRING', 'da034209758b78eaea06dd99c07909ab54c99b45')," +
"('fisherman_minimum_pause_blocks_owner', -1, 'STRING', 'da034209758b78eaea06dd99c07909ab54c99b45')," +
"('fisherman_max_paused_blocks_owner', -1, 'STRING', 'da034209758b78eaea06dd99c07909ab54c99b45')," +
"('fisherman_per_session_owner', -1, 'STRING', 'da034209758b78eaea06dd99c07909ab54c99b45')," +
"('validator_minimum_stake_owner', -1, 'STRING', 'da034209758b78eaea06dd99c07909ab54c99b45')," +
"('validator_unstaking_blocks_owner', -1, 'STRING', 'da034209758b78eaea06dd99c07909ab54c99b45')," +
"('validator_minimum_pause_blocks_owner', -1, 'STRING', 'da034209758b78eaea06dd99c07909ab54c99b45')," +
Expand Down
3 changes: 2 additions & 1 deletion runtime/configs/proto/persistence_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ package configs;

option go_package = "github.com/pokt-network/pocket/runtime/configs";

// CLEANUP: Need to make the configuration be "postgres agnostic"
message PersistenceConfig {
string postgres_url = 1;
string node_schema = 2;
string node_schema = 2; // the postgres schema used to store all the tables for a specific node; useful when multiple nodes share a single postgres instance
string block_store_path = 3;
string tx_indexer_path = 4;
string trees_store_dir = 5;
Expand Down
6 changes: 6 additions & 0 deletions runtime/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.0.36] - 2023-04-28

- Consolidated files for defaults together
- Updated `BlocksPerSession` default to 1
- Added an ability to add options to the `NewGenesisState` helper for more thorough testing
Olshansk marked this conversation as resolved.
Show resolved Hide resolved

## [0.0.0.35] - 2023-04-27

- Removed unneeded `use_rain_tree` P2P config field
Expand Down
Loading