Skip to content

Commit

Permalink
Merge pull request #936 from FactomProject/develop
Browse files Browse the repository at this point in the history
Release v6.5.0 (Confetti)
  • Loading branch information
factom-clay authored Nov 26, 2019
2 parents 87cc555 + a75f109 commit 7acb7ff
Show file tree
Hide file tree
Showing 16 changed files with 279 additions and 155 deletions.
1 change: 1 addition & 0 deletions CLA
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ Tor Hogne Paulsen Tor Hogne
Steven Masley Emyrk Factom Inc.
Michael Lam factablesolutions Factable Solutions LLC
Valentin Ganev sanchopansa Factomatic LLC
Nolan Bauer TRGG3R TRGG3R, LLC; VBIF Factom Protocol Guide
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.4
6.5.0
1 change: 1 addition & 0 deletions common/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,4 @@ const (
//Fast boot save state version (savestate)
//To be increased whenever the data being saved changes from the last version
const SaveStateVersion = 13
const PreBootWindow = 20 // allow an N minute window before boot where messages will be accepted
65 changes: 10 additions & 55 deletions engine/NetworkProcessorNet.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,6 @@ func NetworkProcessorNet(fnode *FactomNode) {
}

func Peers(fnode *FactomNode) {
saltReplayFilterOn := true

crossBootIgnore := func(amsg interfaces.IMsg) bool {
// If we are not syncing, we may ignore some old messages if we are rebooting based on salts
if saltReplayFilterOn {
//var ack *messages.Ack
//switch amsg.Type() {
//case constants.MISSING_MSG_RESPONSE:
// mmrsp := amsg.(*messages.MissingMsgResponse)
// if mmrsp.Ack == nil {
// return false
// }
// ack = mmrsp.Ack.(*messages.Ack)
//case constants.ACK_MSG:
// ack = amsg.(*messages.Ack)
//case constants.DIRECTORY_BLOCK_SIGNATURE_MSG:
// dbs := amsg.(*messages.DirectoryBlockSignature)
// if dbs.Ack == nil {
// return false
// }
// ack = dbs.Ack.(*messages.Ack)
//}

if amsg.Type() == constants.ACK_MSG && amsg != nil {
ack := amsg.(*messages.Ack)
if replaySalt := fnode.State.CrossReplay.ExistOldSalt(ack.Salt); replaySalt {
return true
}
}

}

return false
}

// ackHeight is used in ignoreMsg to determine if we should ignore an acknowledgment
ackHeight := uint32(0)
Expand Down Expand Up @@ -120,9 +86,6 @@ func Peers(fnode *FactomNode) {

for {
now := fnode.State.GetTimestamp()
if now.GetTimeSeconds()-fnode.State.BootTime > int64(constants.CROSSBOOT_SALT_REPLAY_DURATION.Seconds()) {
saltReplayFilterOn = false
}
cnt := 0

for i := 0; i < 100 && fnode.State.APIQueue().Length() > 0; i++ {
Expand Down Expand Up @@ -214,7 +177,6 @@ func Peers(fnode *FactomNode) {

if fnode.State.LLeaderHeight < fnode.State.DBHeightAtBoot+2 {
s := fnode.State
// Allow 20 minute grace period
if s.GetMessageFilterTimestamp() != nil && msg.GetTimestamp().GetTimeMilli() < s.GetMessageFilterTimestamp().GetTimeMilli() {
fnode.State.LogMessage("NetworkInputs", "Drop, too old", msg)
continue
Expand Down Expand Up @@ -250,12 +212,6 @@ func Peers(fnode *FactomNode) {
hash := repeatHash.Fixed()
timestamp := msg.GetTimestamp()

tsv := fnode.State.Replay.IsTSValidAndUpdateState(constants.TIME_TEST, hash, timestamp, now)
if !tsv {
fnode.State.LogMessage("NetworkInputs", fromPeer+" Drop, TS invalid", msg)
continue
}

ignore := ignoreMsg(msg)
if ignore {
fnode.State.LogMessage("NetworkInputs", fromPeer+" Drop, ignoreMsg()", msg)
Expand All @@ -270,14 +226,6 @@ func Peers(fnode *FactomNode) {
// continue
//}

rv := fnode.State.Replay.IsTSValidAndUpdateState(constants.NETWORK_REPLAY, hash, timestamp, now)
if !rv {
fnode.State.LogMessage("NetworkInputs", fromPeer+" Drop, NETWORK_REPLAY", msg)
RepeatMsgs.Inc()
//fnode.MLog.add2(fnode, false, peer.GetNameTo(), "PeerIn", false, msg)
continue
}

regex, _ := fnode.State.GetInputRegEx()

if regex != nil {
Expand Down Expand Up @@ -327,10 +275,17 @@ func Peers(fnode *FactomNode) {
msg.SetNoResend(true)
}

msg.SetNetwork(true)
if !crossBootIgnore(msg) {
sendToExecute(msg, fnode, fromPeer)
// This should be the last check before sendtoexecute because it adds the message to the replay
// as a side effect
rv := fnode.State.Replay.IsTSValidAndUpdateState(constants.NETWORK_REPLAY, hash, timestamp, now)
if !rv {
fnode.State.LogMessage("NetworkInputs", fromPeer+" Drop, NETWORK_REPLAY", msg)
RepeatMsgs.Inc()
//fnode.MLog.add2(fnode, false, peer.GetNameTo(), "PeerIn", false, msg)
continue
}
msg.SetNetwork(true)
sendToExecute(msg, fnode, fromPeer)
} // For a peer read up to 100 messages {...}
} // for each peer {...}
if cnt == 0 {
Expand Down
3 changes: 2 additions & 1 deletion engine/factomd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"runtime"

"github.com/FactomProject/factomd/common/constants"
"github.com/FactomProject/factomd/common/constants/runstate"
. "github.com/FactomProject/factomd/common/globals"
"github.com/FactomProject/factomd/common/interfaces"
Expand Down Expand Up @@ -54,7 +55,7 @@ func Factomd(params *FactomParams, listenToStdin bool) interfaces.IState {
state0.SetLeaderTimestamp(state0.TimestampAtBoot)
// build a timestamp 20 minutes before boot so we will accept messages from nodes who booted before us.
preBootTime := new(primitives.Timestamp)
preBootTime.SetTimeMilli(state0.TimestampAtBoot.GetTimeMilli() - 20*60*1000)
preBootTime.SetTimeMilli(state0.TimestampAtBoot.GetTimeMilli() - constants.PreBootWindow*60*1000)
state0.SetMessageFilterTimestamp(preBootTime)
state0.EFactory = new(electionMsgs.ElectionsFactory)

Expand Down
2 changes: 1 addition & 1 deletion state/HoldingList.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (l *HoldingList) isMsgStale(msg interfaces.IMsg) (res bool) {
// l.s.LogMessage("DependentHolding", "SKIP_DBHT_REVIEW", msg)
}

if msg.GetTimestamp().GetTime().UnixNano() < l.s.GetFilterTimeNano() {
if msg.GetTimestamp().GetTime().UnixNano() < l.s.GetMessageFilterTimestamp().GetTime().UnixNano() {
res = true
}

Expand Down
9 changes: 1 addition & 8 deletions state/dbStateCatchup.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ func (list *DBStateList) Catchup() {

factomSecond := list.State.FactomSecond()

requestTimeout := list.State.RequestTimeout
if requestTimeout < 1*time.Second { // If the timeout is 0 (default), base off blktime
// 10min block == 30s timeout for a request.
// 5min block == 15s timeout for a request.
// 1min block == 3s timeout for a request.
requestTimeout = factomSecond * 5
list.State.RequestTimeout = requestTimeout
}
requestTimeout := time.Duration(list.State.RequestTimeout) * factomSecond
requestLimit := list.State.RequestLimit

// Wait for db to be loaded
Expand Down
201 changes: 193 additions & 8 deletions state/grants.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ func GetHardCodedGrants() []HardGrant {
case "LOCAL":
hardcodegrants = []HardGrant{
// waiting for "real-ish" data from brian
HardGrant{21, 2, validateAddress("FA3oajkmHMfqkNMMShmqpwDThzMCuVrSsBwiXM2kYFVRz3MzxNAJ")}, // Pay Clay 2
HardGrant{31, 4, validateAddress("FA3Ga2XcaheS5NgQ3q22gBpLgE6tXmPu1GhjdU2FsdN2QPMzKJET")}, // Pay Bob 4
HardGrant{21, 3, validateAddress("FA3Ga2XcaheS5NgQ3q22gBpLgE6tXmPu1GhjdU2FsdN2QPMzKJET")}, // Pay Bob 3
HardGrant{41, 2, validateAddress("FA3oajkmHMfqkNMMShmqpwDThzMCuVrSsBwiXM2kYFVRz3MzxNAJ")}, // Pay Clay 2
HardGrant{51, 4, validateAddress("FA3Ga2XcaheS5NgQ3q22gBpLgE6tXmPu1GhjdU2FsdN2QPMzKJET")}, // Pay Bob 4
HardGrant{41, 3, validateAddress("FA3Ga2XcaheS5NgQ3q22gBpLgE6tXmPu1GhjdU2FsdN2QPMzKJET")}, // Pay Bob 3

// Note to future grant implementers. To test the grants that you have coded up on mainnet before deployment on your local machine use this procedure.
// - Code all the grants and add them to the MAIN section. Use the correct activation height, where Height % 25 = 1
Expand All @@ -43,17 +43,24 @@ func GetHardCodedGrants() []HardGrant {
// - Check you are on the second node by pressing s <enter> to print out the summary. It should show "1 f FNode01" to indicate focus is on the new simnode. This means you are viewing that control panel now.
// - Refersh the control panel and make sure that it downloads the blockchain and is keeping up with the first simnode and is not stalled on either of the grant blocks.

// - Note, if set to 11, then there may be an extra payout at block 151
// the TESTNET_COINBASE_PERIOD has a activation height of 25 for local net instead of maxint so after block 25 the
// COINBASE_DECLARATION is changed to 140 so at height 151 we look back 140 blocks and get the grants at height 11
// and pay them out a second time. Perhaps we should handle that differently somehow on any future activation
// heights that change the COINBASE constants. The bug is TESTNET_COINBASE_PERIOD should never activate for local
// networks since it is intended to only apply to test nets.

// Copy (and replace) the new grants to be tested here:
// Centis BV total: 1200 FCT (300 FCT * 2 months) + (600 FCT * 1 month) = 1200 FCT lowered upon request
HardGrant{11, 1200e8, validateAddress("FA2hvRaci9Kks9cLNkEUFcxzUJuUFaaAE1eWYLqa2qk1k9pVFVBp")},
HardGrant{31, 1200e8, validateAddress("FA2hvRaci9Kks9cLNkEUFcxzUJuUFaaAE1eWYLqa2qk1k9pVFVBp")},
// The 42nd Factoid total: 1800 FCT
HardGrant{11, 1800e8, validateAddress("FA3AEL2H9XZy3n199USs2poCEJBkK1Egy6JXhLehfLJjUYMKh1zS")},
HardGrant{31, 1800e8, validateAddress("FA3AEL2H9XZy3n199USs2poCEJBkK1Egy6JXhLehfLJjUYMKh1zS")},
// Factom, Inc. total: 1800 FCT
HardGrant{11, 1800e8, validateAddress("FA2teRURMYTdYAA97zdh7rZDkxNtR1nhjryo34aaskjYqsqRSwZq")},
HardGrant{31, 1800e8, validateAddress("FA2teRURMYTdYAA97zdh7rZDkxNtR1nhjryo34aaskjYqsqRSwZq")},
// Canonical Ledgers total: 1800 FCT
HardGrant{11, 1800e8, validateAddress("FA2PEXgRiPd14NzUP47XfVTgEnvjtLSebBZvnM8gM7cJAMuqWs89")},
HardGrant{31, 1800e8, validateAddress("FA2PEXgRiPd14NzUP47XfVTgEnvjtLSebBZvnM8gM7cJAMuqWs89")},
// DBGrow total: 1800 FCT
HardGrant{11, 1800e8, validateAddress("FA3HSuFo9Soa5ZnG82JHqyKiRi4Pw17LxPTo9AsCaFNLCGkXkgsu")},
HardGrant{31, 1800e8, validateAddress("FA3HSuFo9Soa5ZnG82JHqyKiRi4Pw17LxPTo9AsCaFNLCGkXkgsu")},
}
case "CUSTOM":
hardcodegrants = []HardGrant{}
Expand Down Expand Up @@ -788,6 +795,184 @@ func GetHardCodedGrants() []HardGrant {
// Kompendium total: 2400 FCT
HardGrant{207326, 2400e8, validateAddress("FA3KMPNX8AKdY3tjyKMzZ5cAkqUv97d3QqkJeQnVXk6PXSVgArnr")},
// --------------------------------------------------------

// ********************************
// **** Grant Round 2019-04 ****
// ********************************

// --------------------------------------------------------
// Samuel Vanderwaal-Brian Deery-Nolan Bauer-Nic R-The 42nd Factoid AS-Centis BV -- 9000 FCT
// Guide Compensation 2019-09-07 to 2019-12-07

// Factom, Inc. total: 1800 FCT
HardGrant{221126, 1800e8, validateAddress("FA2teRURMYTdYAA97zdh7rZDkxNtR1nhjryo34aaskjYqsqRSwZq")},

// Nolan Bauer total: 1800 FCT
HardGrant{221126, 1800e8, validateAddress("FA2oecgJW3XWnXzHhQQoULmMeKC97uAgHcPd4kEowTb3csVkbDc9")},

// Nic R total: 1800 FCT
HardGrant{221126, 1800e8, validateAddress("FA3HSuFo9Soa5ZnG82JHqyKiRi4Pw17LxPTo9AsCaFNLCGkXkgsu")},

// The 42nd Factoid AS total: 1800 FCT
HardGrant{221126, 1800e8, validateAddress("FA3AEL2H9XZy3n199USs2poCEJBkK1Egy6JXhLehfLJjUYMKh1zS")},

// Centis BV total: 1800 FCT
HardGrant{221126, 1800e8, validateAddress("FA2hvRaci9Kks9cLNkEUFcxzUJuUFaaAE1eWYLqa2qk1k9pVFVBp")},
// --------------------------------------------------------

// --------------------------------------------------------
// Factom Inc. -- 900 FCT
// Oracle Master Dec 9 2019 - March 9, 2020

// Factom Inc. total: 900 FCT
HardGrant{221126, 900e8, validateAddress("FA3fpiZ91MCRRFjVGfNXK4pg7vx3BT3aSRyoVqgptZCX7N5BNR8P")},
// --------------------------------------------------------

// --------------------------------------------------------
// Factom Inc. -- 660 FCT
// Anchor Master Dec 9 2019 - March 9, 2020

// Factom Inc. total: 660 FCT
HardGrant{221126, 660e8, validateAddress("FA3jySUFtLXb1VdAJJ5NRVNYEtZ4EBSkDB7yn6LuKGQ4P1ntARhx")},
// --------------------------------------------------------

// --------------------------------------------------------
// David Chapman-Factomize -- 15769 FCT
// Core and General Development 2019-12-01 - 2020-02-29

// Factomize total: 15769 FCT
HardGrant{221126, 15769e8, validateAddress("FA3nsSjUy5uSkqMEug8t3VcehZn5w2ciSMpgqFEEsMRwMrHoa9k3")},
// --------------------------------------------------------

// --------------------------------------------------------
// CryptoLogic-The Factoid Authority-Crypto Logic-Bedrock Solutions-De Facto -- 1956 FCT
// Factom Open Node Continuity 2019-12-01 - 2020-02-29

// The Factoid Authority total: 326 FCT
HardGrant{221126, 326e8, validateAddress("FA2LV4s7LKA9BTgWaJNvcr9Yq8rpiH2XD3vEPY3nwSiNSrnRgkpK")},

// Crypto Logic total: 326 FCT
HardGrant{221126, 326e8, validateAddress("FA29wMUjN38BVLbJs6dR6gHHdBys2mpo3wy565JCjquUQTGqNZfb")},

// Bedrock Solutions total: 652 FCT
HardGrant{221126, 652e8, validateAddress("FA2FqYZPfBeRWq7fWSFEhassT5zpMQZm8jwus3yWbzeN3PZPWybm")},

// De Facto total: 652 FCT
HardGrant{221126, 652e8, validateAddress("FA2YeMbN8Z1SsT7Yqw6Np85kWwtFVg2CyJKMDFnuXTawWuWPtzvX")},
// --------------------------------------------------------

// --------------------------------------------------------
// Nolan Bauer-factomatic-David Kuiper-Factom Inc. -- 34740 FCT
// Protocol Development Dec 9 2019 - March 9, 2020

// Nolan Bauer total: 300 FCT
HardGrant{221126, 300e8, validateAddress("FA2oecgJW3XWnXzHhQQoULmMeKC97uAgHcPd4kEowTb3csVkbDc9")},

// factomatic total: 300 FCT
HardGrant{221126, 300e8, validateAddress("FA2944TXTDQKdJDp3TLSANjgMjwK2pQnTSkzE3kQcHWKetCCphcH")},

// David Kuiper total: 300 FCT
HardGrant{221126, 300e8, validateAddress("FA2FqYZPfBeRWq7fWSFEhassT5zpMQZm8jwus3yWbzeN3PZPWybm")},

// Factom Inc. total: 33840 FCT
HardGrant{221126, 33840e8, validateAddress("FA3LwCDE3ZdFkr9nE1Keb5JcHgwXVWpEHydshT1x2qKFdvZELVQz")},
// --------------------------------------------------------

// --------------------------------------------------------
// Samuel Vanderwaal-Exchange Committee -- 5000 FCT
// Legal Fees Reimbursement

// Exchange Committee total: 5000 FCT
HardGrant{221126, 5000e8, validateAddress("FA2fVnbYw3Hr1MCJWktLnGDrYiLnW2HwDBDVRpp3Q355jJRDwvCs")},
// --------------------------------------------------------

// --------------------------------------------------------
// David Chapman-Factomize -- 12069 FCT
// ANO Promotion / Demotion System 2019-12-01 - 2020-02-29

// Factomize total: 12069 FCT
HardGrant{221126, 12069e8, validateAddress("FA3nsSjUy5uSkqMEug8t3VcehZn5w2ciSMpgqFEEsMRwMrHoa9k3")},
// --------------------------------------------------------

// --------------------------------------------------------
// mboender-Sphereon -- 14909 FCT
// Core Development Continuation 2019-12-02 - 2020-02-28

// Sphereon total: 14909 FCT
HardGrant{221126, 14909e8, validateAddress("FA3igxrULYqL5w4oq9vXwWzWURtvejfYh64iPZaeRqZfLpFdkFgD")},
// --------------------------------------------------------

// --------------------------------------------------------
// Samuel Vanderwaal-Exchange Committee -- 175 FCT
// G Suite Service

// Exchange Committee total: 175 FCT
HardGrant{221126, 175e8, validateAddress("FA2kd7iAuCrR2GTV39UMaBTphzvQZYVYmvLJYGsjoJRjEGoVNQFd")},
// --------------------------------------------------------

// --------------------------------------------------------
// Devon Katz-Canonical Ledgers-DBGrow -- 5448 FCT
// FAT Development 4 - Continuation 2019-12-01 - 2020-02-01

// Canonical Ledgers total: 2980 FCT
HardGrant{221126, 2980e8, validateAddress("FA2xccSAfhGm5k4tPaXF9741xkQ52drWjoJodQhpPxDxepdqasMM")},

// DBGrow total: 2468 FCT
HardGrant{221126, 2468e8, validateAddress("FA3HSuFo9Soa5ZnG82JHqyKiRi4Pw17LxPTo9AsCaFNLCGkXkgsu")},
// --------------------------------------------------------

// --------------------------------------------------------
// David Chapman-Motion Factory-Factomize -- 800 FCT
// PegNet Explainer Video Backpay Grant

// Motion Factory total: 800 FCT
HardGrant{221126, 800e8, validateAddress("FA3cRbg1CAzBvXpp8v3AfGuxzjePDbwqGr71MvLNanTX2QKDF1Cz")},
// --------------------------------------------------------

// --------------------------------------------------------
// Valentin Ganev-Factomatic -- 5500 FCT
// Python DID library

// Factomatic total: 5500 FCT
HardGrant{221126, 5500e8, validateAddress("FA2QuNHNxgJBZyPggxkU8C16YReA4xFFxUvAGpu9azF3TaZg46SF")},
// --------------------------------------------------------

// --------------------------------------------------------
// Cody B -- 950 FCT
// Discord Daily Digest Screenshot (Continuation) 2019-11-01 - 2020-01-31

// Cody B total: 950 FCT
HardGrant{221126, 950e8, validateAddress("FA2WvyDhuKerk3RyVeSiTUonmcn7RuPRJGFQB6oCfroSys7NW3q2")},
// --------------------------------------------------------

// --------------------------------------------------------
// Jason Gregoire-Kompendium -- 730 FCT
// [Back-pay] Further Development of Open API – Client Library & Server Expansion

// Kompendium total: 730 FCT
HardGrant{221126, 730e8, validateAddress("FA3KMPNX8AKdY3tjyKMzZ5cAkqUv97d3QqkJeQnVXk6PXSVgArnr")},
// --------------------------------------------------------

// ********************************
// ** BUG Bounty payout 2019-04 **
// ********************************
// --------------------------------------------------------
// Niels Klomp -- Core committee -- 205 FCT
// This grant is for the Bug Bounty program and pays out 3 submissions, BB-001, BB-002 and BB-003
// Payout will go to the following addresses, with a managed intermediary address.
// (Not all exchanges support coinbase transactions)
//
// BB-001 -- 17 FCT -- FA3ShvrkkVrCWGGiGqmAPykhLHhuZZtetUYBTYEss4KPsm5c7G6c
// BB-002 -- 17 FCT -- FA29JkXWYzwgLpQcrqSPsouy23AMgbrQcr6PTbAu6Q2tGXNveL4P
// BB-003 -- 171 FCT -- FA23fEJadueuxf8SsohpnDj3QYmZQ7mpMjWrFb1GHTQhByyDYMxe
//
// Full details for core committee:
// https://docs.google.com/spreadsheets/d/15fo9PCNt4meJGSd-V9iZENAiPTUx7dLpd990tH1dADY/edit#gid=0

// Bug bounty total: 205 FCT, remaining funds: 795 FCT
HardGrant{221126, 205e8, validateAddress("FA22J4Age2aLKRw1cKQckTPzK6Wpb6GCKKdYv6dp7SVsxzGyNqy4")},
// --------------------------------------------------------

}

default:
Expand Down
Loading

0 comments on commit 7acb7ff

Please sign in to comment.