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

Update Mesh's Pocket-Core to RC-0.11.1 #13

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
16f6f31
Added /v1/health endpoint and update rpc spec.
jorgecuesta Oct 12, 2022
5cabe5c
Fix #1457; Fix #1484;
jorgecuesta Oct 12, 2022
67eace1
remove idle timeout in favor to use default (5 seg) because otherwise…
jorgecuesta Oct 20, 2022
db02135
Removed hardcoded values in favor of use GlobalPocketConfig
jorgecuesta Nov 28, 2022
8b7b3e4
Initial Geo-Mesh work
jorgecuesta Oct 12, 2022
3aa26c0
* Update mesh start time to start at same nodes will.
jorgecuesta Oct 26, 2022
346f8d4
* Added background cache compaction
jorgecuesta Oct 31, 2022
d7695a3
* Fixed chains hot reload with editor like vim
jorgecuesta Nov 4, 2022
9ba6e99
* Removed unnecessary initCron call
jorgecuesta Nov 9, 2022
c48811d
* Fixed issue that allow session to remains on cache forever if the p…
jorgecuesta Nov 10, 2022
28d59a8
* Removed disk session storage due to issues with size growing (tempo…
jorgecuesta Dec 23, 2022
6e5eb46
Fixed:
jorgecuesta Dec 28, 2022
0610cd0
Refactor handle relay to ensure relays are stored in time and deleted…
jorgecuesta Jan 10, 2023
97fc658
Fixed issue preventing nodes to track remaining relays properly for e…
jorgecuesta Jan 11, 2023
90e3fbb
Update cleanup old session cron time.
jorgecuesta Jan 11, 2023
546f31f
Remove random selection of servicer because produce error for those r…
jorgecuesta Jan 12, 2023
38997c9
Update go.mod. Update Servicer version to latest official release RC-…
jorgecuesta Mar 22, 2023
0c17fee
Update mesh.md
jorgecuesta Mar 22, 2023
541bd36
Initial rework to speed up bootstrap times of mesh client.
jorgecuesta Mar 31, 2023
cc0efa6
Fixed minor issues.
jorgecuesta Apr 4, 2023
bd9c5b9
Replace sync.Map with xsync.Map to use Generic in favor of performanc…
jorgecuesta Apr 4, 2023
29e1b9a
Added worker metrics.
jorgecuesta Apr 5, 2023
396647f
Update docs.
jorgecuesta Apr 5, 2023
73b14f7
Fixed metrics and cyclic dependencies.
jorgecuesta Apr 6, 2023
ed3449b
Fixed a bug that disallow the ability to reuse http 1.x connections.
jorgecuesta Apr 10, 2023
0b4aec2
Added support to Chains & Servicer http client options to be configur…
jorgecuesta Apr 10, 2023
1ab8574
Updated rpc-spec.yaml.
jorgecuesta Apr 10, 2023
45b2a69
Fixed issue with /v1/private/mesh/updatechains endpoint.
jorgecuesta Apr 10, 2023
54cc0e7
Added specialized metrics for mesh instead of reuse the pocket client.
jorgecuesta Apr 10, 2023
7989d31
Removed dynamic capacity on servicer worker due to the need of handle…
jorgecuesta Apr 12, 2023
d4e9380
Updated docs.
jorgecuesta Apr 12, 2023
30de368
Added option to allow debug logs omit request/response payloads.
jorgecuesta Apr 13, 2023
0e4d60e
Added json schema support to additional properties. Those will not im…
jorgecuesta Apr 13, 2023
1da8ed6
Rework metrics to handle less metrics with more labels. Enhance group…
jorgecuesta Apr 17, 2023
ce66a6f
Set chains_name_map default as empty so avoid to read it and write an…
jorgecuesta Apr 17, 2023
13d1cb0
Added metrics_moniker.
jorgecuesta Apr 19, 2023
7484dfe
Fixed issue with error metrics
jorgecuesta Apr 20, 2023
ee3b529
Rename status_label to status_code.
jorgecuesta Apr 21, 2023
629a2f8
Moved authtoken to Authorization header to avoid the security token c…
jorgecuesta Apr 21, 2023
7c7b4e7
Enhance code based on blade suggestions.
jorgecuesta Apr 21, 2023
17931ec
Added golang-set dependency link to docs.
jorgecuesta Apr 21, 2023
a7272f4
Added missing chain request log.
jorgecuesta Apr 22, 2023
22d4032
Added support to configure more http client that handle mesh request …
jorgecuesta Apr 22, 2023
a19a3d3
Fixed issue with log chain requests.
jorgecuesta Apr 22, 2023
c53a5cc
Allow to remove non-printable characters from chain path
jorgecuesta Apr 22, 2023
bde223a
Updated default values.
jorgecuesta Apr 24, 2023
c26b742
Updated mesh.md
jorgecuesta Apr 24, 2023
dd87d83
Updated mesh.md and default value of chain_request_path_cleanup
jorgecuesta Apr 24, 2023
dfff2d8
Renamed invalidate session codes.
jorgecuesta May 3, 2023
a6d193b
Bump version
jorgecuesta May 3, 2023
35ce5da
Fixed issue on report metrics without proper return http code from bl…
jorgecuesta May 3, 2023
9074e75
Fixed issue on report metrics without proper return http code from bl…
jorgecuesta May 3, 2023
52bb32c
Added support to lean node for evidence worker. Now is one worker per…
jorgecuesta May 4, 2023
e39d129
Remove chain url from the error message returned as part of the respo…
jorgecuesta May 10, 2023
ad5b804
Fixed issue that was forcing retry relays notifications when they sho…
jorgecuesta Jun 13, 2023
140d730
Enhance code base on @PoktBlade comments.
jorgecuesta Jun 13, 2023
deeb135
Initial work over session fix. WIP on unit tests (learning how to)
jorgecuesta Jun 5, 2023
d08aa41
wip on add test to session storage.
jorgecuesta Jun 8, 2023
6635f3a
Rebase on latest geo-mesh commit.
jorgecuesta Jun 14, 2023
4f7126f
Rework ShouldAssumeOptimisticSession function.
jorgecuesta Jun 14, 2023
49de50e
Fixed and issue that provoke session not behind found.
jorgecuesta Jun 14, 2023
998ce04
Added missing blockchain validation on relays.
jorgecuesta Jun 14, 2023
000603c
Bump Version to BETA-0.4.0
jorgecuesta Jun 21, 2023
97d752c
Added "current" session to the same logic of the "optimistic" one to …
jorgecuesta Jun 22, 2023
ae6857f
Refactored session.go to handle session in a single map to avoid race…
jorgecuesta Jun 30, 2023
a1266d5
remove unnecessary log. fix session_test.go
jorgecuesta Jul 4, 2023
83d8ef6
add lookback session rollover support
Jul 11, 2023
b657c97
cleanup relay.go and fix potential dereference runtime error
Jul 11, 2023
4287bb5
refractor session cleanup math
Jul 11, 2023
9113732
add node session comments
Jul 11, 2023
e68dc22
add comments about node session
Jul 11, 2023
4eb1ccb
add comments about node session
Jul 11, 2023
1e49704
fix relay vaidation and small cleanup on if else
Jul 11, 2023
3bb85dc
Bump Version to RC-0.4.0
jorgecuesta Jul 11, 2023
0e51a5a
Added log_relay_request to help PNI debug ongoing issue with the stuc…
jorgecuesta Jul 13, 2023
aee1aca
Avoid evaluation of the tolerance for the future session because that…
jorgecuesta Jul 13, 2023
55f650f
Moved where the non processed relay error is printed to be able to ad…
jorgecuesta Jul 14, 2023
5f5c2cb
Fixed relay request headers log.
jorgecuesta Jul 14, 2023
ef18426
add better proof validation
Jul 15, 2023
3706fec
add duplicate proof detection
Jul 16, 2023
b983243
Change Version to BETA-0.4.2 until we decide it is an RC
jorgecuesta Jul 15, 2023
56f4d0e
remove unnecessary comment
Jul 16, 2023
5050494
add relay to bloom filter immediately validating the relay
Jul 17, 2023
d327697
seperate to its own functions
Jul 17, 2023
dc78a20
add optimistic duplicate relay map
Jul 17, 2023
e627d7d
remove unnecessary return of ns
Jul 17, 2023
4b9500f
add a more compute/memory efficient key
Jul 17, 2023
0cd0477
add byte<> string conversion and replace storing relay with a empty m…
Jul 17, 2023
894e51e
use the relay proof instead of relay obj
Jul 17, 2023
4850a1f
init map
Jul 17, 2023
37c4d62
Fixed memory issue due to old sessions not been deleted from local st…
jorgecuesta Jul 20, 2023
ac22752
Updated workflow to achieve multi-arch build on an automated way.
jorgecuesta Jan 22, 2024
3aadc69
Add mainnet seeds to README (#1594)
Olshansk Jan 23, 2024
e47bc70
Update AppVersion to RC-0.11.1 (#1595)
msmania Jan 24, 2024
7044e46
Merge branch 'staging' of github.com:pokt-network/pocket-core into ME…
Jan 28, 2024
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
15 changes: 7 additions & 8 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ name: Build and push images
on:
workflow_dispatch:
push:
branches: [staging]
branches: [geo-mesh]
tags: ['*']
pull_request:
branches: [staging]
branches: [geo-mesh]

jobs:
build-images:
Expand All @@ -27,20 +27,19 @@ jobs:
DOCKER_METADATA_PR_HEAD_SHA: "true"
with:
images: |
ghcr.io/pokt-network/pocket-v0
poktscan/pocket-core
tags: |
type=schedule
type=ref,event=tag
type=ref,event=branch
type=ref,event=pr
type=sha
type=sha,format=long
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
Expand Down
46 changes: 31 additions & 15 deletions .github/workflows/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/expect

# Command to run
set command $argv
set timeout -1

# Send `pocket stop` when interrupted to prevent corruption
proc graceful_exit {} {
send_user "Gracefully exiting Pocket...\n"
spawn sh -c "pocket stop"
}

trap graceful_exit {SIGINT SIGTERM}

# Command to run
set command $argv
set timeout -1
proc graceful_mesh_exit {pid} {
send_user "Gracefully exiting Pocket...\n"
exec kill -SIGTERM $pid
}

# Create work dir
spawn sh -c "mkdir -p /home/app/.pocket/config"
expect eof

# Pull variables from env if set
set genesis ""
Expand All @@ -26,6 +26,12 @@ catch {set chains $env(POCKET_CORE_CHAINS)}
set config ""
catch {set config $env(POCKET_CORE_CONFIG)}

set core_key ""
catch {set core_key $env(POCKET_CORE_KEY)}

set core_passphrase ""
catch {set core_passphrase $env(POCKET_CORE_PASSPHRASE)}

# Create dynamic config files
if {$genesis != ""} {
set genesis_file [open /home/app/.pocket/config/genesis.json w]
Expand All @@ -46,26 +52,36 @@ if {$config != ""} {
send_user "CONFIG loaded from env\n"
}

# If key isn't passed in, start the node
if { $env(POCKET_CORE_KEY) eq "" } {
# if not --keybase=false
# e.g. "pocket start --keybase=false --mainnet --datadir=/home/app/.pocket/"
if {[regexp -nocase "keybase=false" $command]} {
spawn sh -c "$command"
} elseif { $core_key eq "" } {
# If key isn't passed in, start the node
log_user 0
spawn sh -c "$command"
send -- "$env(POCKET_CORE_PASSPHRASE)\n"
send -- "$core_passphrase\n"
log_user 1
} else {
# If key is passed in, load it into the local accounts
# If key is passed in, load it into the local accounts
log_user 0
spawn pocket accounts import-raw $env(POCKET_CORE_KEY)
spawn pocket accounts import-raw $core_key
sleep 1
send -- "$env(POCKET_CORE_PASSPHRASE)\n"
send -- "$core_passphrase\n"
expect eof
spawn sh -c "pocket accounts set-validator `pocket accounts list | cut -d' ' -f2- `"
sleep 1
send -- "$env(POCKET_CORE_PASSPHRASE)\n"
send -- "$core_passphrase\n"
expect eof
log_user 1
spawn sh -c "$command"
}

set pid [exp_pid]
if {![regexp -nocase "start-mesh" $command]} {
trap graceful_exit {SIGINT SIGTERM}
} else {
trap "graceful_mesh_exit $pid" {SIGINT SIGTERM}
}
expect eof
exit
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The Pocket Core application will allow anyone to spin up a Pocket Network full n
- [Charts \& Analytics](#charts--analytics)
- [Running the tests](#running-the-tests)
- [Contributing](#contributing)
- [MainNet Seeds](#mainnet-seeds)
- [Seeds (MainNet \& TestNet)](#seeds-mainnet--testnet)
- [Docker Image](#docker-image)
- [Support \& Contact](#support--contact)
- [GPokT](#gpokt)
Expand Down Expand Up @@ -131,9 +131,11 @@ To run the Pocket Core unit tests, `go test -short -v -p 1 ./...`

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on contributions and the process of submitting pull requests.

## MainNet Seeds
## Seeds (MainNet & TestNet)

MainNet seeds are being maintained by [NodeFleet](https://nodefleet.org/) and more details can be found at [docs.pokt.network/node/seeds/](https://docs.pokt.network/node/seeds/).
Seeds are maintained by [NodeFleet](https://nodefleet.org/).

You can find all the details at [pokt-network/pocket-seeds](https://github.com/pokt-network/pocket-seeds).

## Docker Image

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

const (
AppVersion = "BETA-0.11.1"
AppVersion = "RC-0.11.1"
)

// NewPocketCoreApp is a constructor function for PocketCoreApp
Expand Down
24 changes: 23 additions & 1 deletion app/cmd/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ func init() {
startCmd.Flags().BoolVar(&profileApp, "profileApp", false, "expose cpu & memory profiling")
startCmd.Flags().BoolVar(&useCache, "useCache", false, "use cache")
startCmd.Flags().BoolVar(&forceSetValidatorsLean, "forceSetValidators", false, "reads your lean_pocket_user_key_file (lean_nodes_keys.json) and updates your last signed state/validator files before starting your node")
meshCmd.Flags().BoolVar(&simulateRelay, "simulateRelay", false, "would you like to be able to test your relays")
rootCmd.AddCommand(startCmd)
rootCmd.AddCommand(meshCmd)
rootCmd.AddCommand(resetCmd)
rootCmd.AddCommand(version)
rootCmd.AddCommand(stopCmd)
Expand Down Expand Up @@ -96,7 +98,7 @@ func start(cmd *cobra.Command, args []string) {
genesisType = app.TestnetGenesisType
}
tmNode := app.InitApp(datadir, tmNode, persistentPeers, seeds, remoteCLIURL, keybase, genesisType, useCache, forceSetValidatorsLean)
go rpc.StartRPC(app.GlobalConfig.PocketConfig.RPCPort, app.GlobalConfig.PocketConfig.RPCTimeout, simulateRelay, profileApp, allBlockTxs, app.GlobalConfig.PocketConfig.ChainsHotReload)
go rpc.StartRPC(app.GlobalConfig.PocketConfig.RPCPort, app.GlobalConfig.PocketConfig.RPCTimeout, simulateRelay, profileApp, allBlockTxs, app.GlobalConfig.PocketConfig.ChainsHotReload, app.GlobalConfig.PocketConfig.MeshNode)
// trap kill signals (2,3,15,9)
signalChannel := make(chan os.Signal, 1)
signal.Notify(signalChannel,
Expand All @@ -120,6 +122,26 @@ func start(cmd *cobra.Command, args []string) {
}()
}

var meshCmd = &cobra.Command{
Use: "start-mesh",
Short: "starts pocket-mesh daemon",
Long: `Starts the Pocket mesh node, picks up the config from the assigned <datadir>`,
Run: func(cmd *cobra.Command, args []string) {
t := time.Unix(1666886400, 0) // Wed, October 27, 2022 12:00:00 PM GMT-04:00
sleepDuration := time.Until(t)
if time.Now().Before(t) {
fmt.Println("Sleeping for ", sleepDuration)
time.Sleep(sleepDuration)
}
startMesh(cmd, args)
},
}

func startMesh(cmd *cobra.Command, args []string) {
app.InitMeshConfig(datadir)
rpc.StartMeshRPC(simulateRelay)
}

// resetCmd represents the reset command
var resetCmd = &cobra.Command{
Use: "reset",
Expand Down
6 changes: 3 additions & 3 deletions app/cmd/rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func Relay(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
WriteJSONResponseWithCode(w, string(j), r.URL.Path, r.Host, 400)
return
}
res, dispatch, err := app.PCA.HandleRelay(relay)
res, dispatch, err := app.PCA.HandleRelay(relay, false)
if err != nil {
response := RPCRelayErrorResponse{
Error: err,
Expand Down Expand Up @@ -191,13 +191,13 @@ func SendRawTx(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
WriteJSONResponse(w, string(j), r.URL.Path, r.Host)
}

type simRelayParams struct {
type SimRelayParams struct {
RelayNetworkID string `json:"relay_network_id"` // RelayNetworkID
Payload types.Payload `json:"payload"` // the data payload of the request
}

func SimRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
var params = simRelayParams{}
var params = SimRelayParams{}
if err := PopModel(w, r, ps, &params); err != nil {
WriteErrorResponse(w, 400, err.Error())
return
Expand Down
Loading
Loading