diff options
author | John Lee <64482439+algojohnlee@users.noreply.github.com> | 2022-08-15 14:11:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 14:11:32 -0400 |
commit | 379ec4f8e1b7f81b8494e3ec889c7ffc8ee67389 (patch) | |
tree | 531173035f49598f90196096e1f169388b762bac | |
parent | 22c3d69c70e81ac43b78fa18718b615c64648c9a (diff) | |
parent | 4444b7c3ff0a7075ebf923f2a1b4d3c1334f225a (diff) |
Merge pull request #4414 from onetechnical/relbeta3.9.1v3.9.1-beta
-rw-r--r-- | buildnumber.dat | 2 | ||||
-rw-r--r-- | catchup/catchpointService.go | 17 | ||||
-rw-r--r-- | catchup/service_test.go | 6 | ||||
-rw-r--r-- | daemon/algod/api/algod.oas2.json | 75 | ||||
-rw-r--r-- | daemon/algod/api/algod.oas3.yml | 79 | ||||
-rw-r--r-- | daemon/algod/api/algod2.oas2.json | 0 | ||||
-rw-r--r-- | daemon/algod/api/server/v2/generated/private/routes.go | 60 | ||||
-rw-r--r-- | daemon/algod/api/server/v2/generated/private/types.go | 31 | ||||
-rw-r--r-- | daemon/algod/api/server/v2/generated/routes.go | 166 | ||||
-rw-r--r-- | daemon/algod/api/server/v2/generated/types.go | 31 | ||||
-rw-r--r-- | test/e2e-go/cli/goal/expect/catchpointCatchupWebProxy/webproxy.go | 6 | ||||
-rw-r--r-- | test/e2e-go/features/catchup/catchpointCatchup_test.go | 79 | ||||
-rw-r--r-- | test/e2e-go/features/stateproofs/stateproofs_test.go | 51 | ||||
-rw-r--r-- | test/framework/fixtures/webProxyFixture.go | 18 | ||||
-rw-r--r-- | test/testdata/nettemplates/RichAccountStateProofSmall.json | 20 | ||||
-rw-r--r-- | test/testdata/nettemplates/StateProofSmall.json | 20 |
16 files changed, 394 insertions, 267 deletions
diff --git a/buildnumber.dat b/buildnumber.dat index 573541ac9..d00491fd7 100644 --- a/buildnumber.dat +++ b/buildnumber.dat @@ -1 +1 @@ -0 +1 diff --git a/catchup/catchpointService.go b/catchup/catchpointService.go index 5d01fa960..99031a0c1 100644 --- a/catchup/catchpointService.go +++ b/catchup/catchpointService.go @@ -19,10 +19,11 @@ package catchup import ( "context" "fmt" - "github.com/algorand/go-algorand/stateproof" "sync" "time" + "github.com/algorand/go-algorand/stateproof" + "github.com/algorand/go-deadlock" "github.com/algorand/go-algorand/config" @@ -473,8 +474,10 @@ func lookbackForStateproofsSupport(topBlock *bookkeeping.Block) uint64 { return 0 } lowestStateProofRound := stateproof.GetOldestExpectedStateProof(&topBlock.BlockHeader) - // in order to be able to confirm lowestStateProofRound we need to have round number: (lowestStateProofRound - stateproofInterval) + // in order to be able to confirm/build lowestStateProofRound we would need to reconstruct + // the corresponding voterForRound which is (lowestStateProofRound - stateproofInterval - VotersLookback) lowestStateProofRound = lowestStateProofRound.SubSaturate(basics.Round(proto.StateProofInterval)) + lowestStateProofRound = lowestStateProofRound.SubSaturate(basics.Round(proto.StateProofVotersLookback)) return uint64(topBlock.Round().SubSaturate(lowestStateProofRound)) } @@ -497,6 +500,7 @@ func (cs *CatchpointCatchupService) processStageBlocksDownload() (err error) { if lookback < lookbackForStateProofSupport { lookback = lookbackForStateProofSupport } + // in case the effective lookback is going before our rounds count, trim it there. // ( a catchpoint is generated starting round MaxBalLookback, and this is a possible in any round in the range of MaxBalLookback..MaxTxnLife) if lookback >= uint64(topBlock.Round()) { @@ -586,9 +590,12 @@ func (cs *CatchpointCatchupService) processStageBlocksDownload() (err error) { return cs.abort(fmt.Errorf("processStageBlocksDownload: downloaded block content does not match downloaded block header")) } - cs.updateBlockRetrievalStatistics(0, 1) - peerRank := cs.blocksDownloadPeerSelector.peerDownloadDurationToRank(psp, blockDownloadDuration) - cs.blocksDownloadPeerSelector.rankPeer(psp, peerRank) + if psp != nil { + // the block might have been retrieved from the local ledger, nothing to rank + cs.updateBlockRetrievalStatistics(0, 1) + peerRank := cs.blocksDownloadPeerSelector.peerDownloadDurationToRank(psp, blockDownloadDuration) + cs.blocksDownloadPeerSelector.rankPeer(psp, peerRank) + } // all good, persist and move on. err = cs.ledgerAccessor.StoreBlock(cs.ctx, blk) diff --git a/catchup/service_test.go b/catchup/service_test.go index 679ee3239..676a283ba 100644 --- a/catchup/service_test.go +++ b/catchup/service_test.go @@ -988,7 +988,7 @@ func TestDownloadBlocksToSupportStateProofs(t *testing.T) { lookback := lookbackForStateproofsSupport(&topBlk) oldestRound := topBlk.BlockHeader.Round.SubSaturate(basics.Round(lookback)) - assert.Equal(t, uint64(oldestRound), 512-config.Consensus[protocol.ConsensusFuture].StateProofInterval) + assert.Equal(t, uint64(oldestRound), 512-config.Consensus[protocol.ConsensusFuture].StateProofInterval-config.Consensus[protocol.ConsensusFuture].StateProofVotersLookback) // the network has made progress and now it is on round 8000. in this case we would not download blocks to cover 512. // instead, we will download blocks to confirm only the recovery period lookback. @@ -1002,7 +1002,9 @@ func TestDownloadBlocksToSupportStateProofs(t *testing.T) { lookback = lookbackForStateproofsSupport(&topBlk) oldestRound = topBlk.BlockHeader.Round.SubSaturate(basics.Round(lookback)) - lowestRoundToRetain := 8000 - (8000 % 256) - (config.Consensus[protocol.ConsensusCurrentVersion].StateProofInterval * (config.Consensus[protocol.ConsensusCurrentVersion].StateProofMaxRecoveryIntervals + 1)) + lowestRoundToRetain := 8000 - (8000 % config.Consensus[protocol.ConsensusCurrentVersion].StateProofInterval) - + config.Consensus[protocol.ConsensusCurrentVersion].StateProofInterval*(config.Consensus[protocol.ConsensusCurrentVersion].StateProofMaxRecoveryIntervals+1) - config.Consensus[protocol.ConsensusFuture].StateProofVotersLookback + assert.Equal(t, uint64(oldestRound), lowestRoundToRetain) topBlk = bookkeeping.Block{} diff --git a/daemon/algod/api/algod.oas2.json b/daemon/algod/api/algod.oas2.json index c95c0dbd1..9af8a2aef 100644 --- a/daemon/algod/api/algod.oas2.json +++ b/daemon/algod/api/algod.oas2.json @@ -2683,42 +2683,7 @@ ], "properties": { "Message": { - "description": "Represents the message that the state proofs are attesting to.", - "type": "object", - "required": [ - "BlockHeadersCommitment", - "VotersCommitment", - "LnProvenWeight", - "FirstAttestedRound", - "LastAttestedRound" - ], - "properties": { - "BlockHeadersCommitment": { - "description": "The vector commitment root on all light block headers within a state proof interval.", - "type": "string", - "format": "byte" - }, - "VotersCommitment": { - "description": "The vector commitment root of the top N accounts to sign the next StateProof.", - "type": "string", - "format": "byte" - }, - "LnProvenWeight": { - "description": "An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof.", - "type": "integer", - "x-algorand-format": "uint64" - }, - "FirstAttestedRound": { - "description": "The first round the message attests to.", - "type": "integer", - "x-algorand-format": "uint64" - }, - "LastAttestedRound": { - "description": "The last round the message attests to.", - "type": "integer", - "x-algorand-format": "uint64" - } - } + "$ref": "#/definitions/StateProofMessage" }, "StateProof": { "description": "The encoded StateProof for the message.", @@ -2750,6 +2715,44 @@ "format": "byte" } } + }, + "StateProofMessage": { + "description": "Represents the message that the state proofs are attesting to.", + "type": "object", + "required": [ + "BlockHeadersCommitment", + "VotersCommitment", + "LnProvenWeight", + "FirstAttestedRound", + "LastAttestedRound" + ], + "properties": { + "BlockHeadersCommitment": { + "description": "The vector commitment root on all light block headers within a state proof interval.", + "type": "string", + "format": "byte" + }, + "VotersCommitment": { + "description": "The vector commitment root of the top N accounts to sign the next StateProof.", + "type": "string", + "format": "byte" + }, + "LnProvenWeight": { + "description": "An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof.", + "type": "integer", + "x-algorand-format": "uint64" + }, + "FirstAttestedRound": { + "description": "The first round the message attests to.", + "type": "integer", + "x-algorand-format": "uint64" + }, + "LastAttestedRound": { + "description": "The last round the message attests to.", + "type": "integer", + "x-algorand-format": "uint64" + } + } } }, "parameters": { diff --git a/daemon/algod/api/algod.oas3.yml b/daemon/algod/api/algod.oas3.yml index 44d4d1b95..404da3a2e 100644 --- a/daemon/algod/api/algod.oas3.yml +++ b/daemon/algod/api/algod.oas3.yml @@ -1623,44 +1623,7 @@ "description": "Represents a state proof and its corresponding message", "properties": { "Message": { - "description": "Represents the message that the state proofs are attesting to.", - "properties": { - "BlockHeadersCommitment": { - "description": "The vector commitment root on all light block headers within a state proof interval.", - "format": "byte", - "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", - "type": "string" - }, - "FirstAttestedRound": { - "description": "The first round the message attests to.", - "type": "integer", - "x-algorand-format": "uint64" - }, - "LastAttestedRound": { - "description": "The last round the message attests to.", - "type": "integer", - "x-algorand-format": "uint64" - }, - "LnProvenWeight": { - "description": "An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof.", - "type": "integer", - "x-algorand-format": "uint64" - }, - "VotersCommitment": { - "description": "The vector commitment root of the top N accounts to sign the next StateProof.", - "format": "byte", - "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", - "type": "string" - } - }, - "required": [ - "BlockHeadersCommitment", - "FirstAttestedRound", - "LastAttestedRound", - "LnProvenWeight", - "VotersCommitment" - ], - "type": "object" + "$ref": "#/components/schemas/StateProofMessage" }, "StateProof": { "description": "The encoded StateProof for the message.", @@ -1675,6 +1638,46 @@ ], "type": "object" }, + "StateProofMessage": { + "description": "Represents the message that the state proofs are attesting to.", + "properties": { + "BlockHeadersCommitment": { + "description": "The vector commitment root on all light block headers within a state proof interval.", + "format": "byte", + "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "type": "string" + }, + "FirstAttestedRound": { + "description": "The first round the message attests to.", + "type": "integer", + "x-algorand-format": "uint64" + }, + "LastAttestedRound": { + "description": "The last round the message attests to.", + "type": "integer", + "x-algorand-format": "uint64" + }, + "LnProvenWeight": { + "description": "An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof.", + "type": "integer", + "x-algorand-format": "uint64" + }, + "VotersCommitment": { + "description": "The vector commitment root of the top N accounts to sign the next StateProof.", + "format": "byte", + "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "type": "string" + } + }, + "required": [ + "BlockHeadersCommitment", + "FirstAttestedRound", + "LastAttestedRound", + "LnProvenWeight", + "VotersCommitment" + ], + "type": "object" + }, "TealKeyValue": { "description": "Represents a key-value pair in an application store.", "properties": { diff --git a/daemon/algod/api/algod2.oas2.json b/daemon/algod/api/algod2.oas2.json new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/daemon/algod/api/algod2.oas2.json diff --git a/daemon/algod/api/server/v2/generated/private/routes.go b/daemon/algod/api/server/v2/generated/private/routes.go index 2ea4c4033..921f69d94 100644 --- a/daemon/algod/api/server/v2/generated/private/routes.go +++ b/daemon/algod/api/server/v2/generated/private/routes.go @@ -437,36 +437,36 @@ var swaggerSpec = []string{ "sJlb+TtdU97U/GkfaytC2TUEKbSd3b5Xg0Bc98lXdgGre4Hzz1Sqp5NSiDwZMBcf96sYdM/AOUvPISPm", "7vAxJAOVwMlXaKWs/YGX643P2i9L4JA9nhFi1PKi1BvvGmwX5OxMzh/pbfNf4axZZQuLOH1/9pHHw5+w", "5Ie8I3/zw2znagoM87vjVHaQHWUCrgYqKEh6GamLP/atxoizrlurvCEqC0VMSrllzuio893X+SOkHxTr", - "3q79hCnlPuszFdKajlBa8gadrvDy49Ajhx290T+ZWZ+zYEqFEbWGKShbAEv0haTAKKBe17p2fPP7Kjnm", - "QwuONSL6qrxC0xjWWQwRYehMXtD84dVxTJQ/RHy411ziCw31uRDJFpXqdt73t3TU3IHudn9T8xM0H/wT", - "zB5FbZpuKGcXrAuQ+7ppWA+I5iQXzUMEOCS5xDGtEXT/JVm4CMtSQsoU6wSfX/oScLX6ghVRm0d+tutL", - "u9b5i9B3IGMn8IqSvGvKSWmB/K6BsDn7f3Ig3cDJjVJ5jPp6ZBHB3yD3PdltcgueJfCyjiPmPxlxP9Ys", - "N1hKbKVhUucORn/esgPbQoSdOAwh4Z7twYED+ob24H666tjl4TpwQysF/XWOvmdbuI1csc3axjoz+sgd", - "9kHoxRgfRLxomumOThCLEKw4SBBU8tv+b0TCEkuKC/LkCU7w5MnUNf3tafuzYVxPnkQFsAdzf7Re/nXz", - "xijml6G4PRubNhAi2tmPiuXZLsJoBfw25f0xpPVXFxr9pzww8Ku1hPaPqivNfBPHa3cTEDGRtbYmD6YK", - "QnlHRPG6brPo28wK0koyvcGMbW84Y79GK+F8V9vana+mzvFzt7wW51Dn/DeW+Up5OeI7Yd9yLow0jG5v", - "jW89vbmiRZmDOyhfP1r8HZ7943m292z/74t/7L3YS+H5i1d7e/TVc7r/6tk+PP3Hi+d7sL98+WrxNHv6", - "/Oni+dPnL1+8Sp893188f/nq748MHzIgW0AnPj9o8j/xFY7k8OQ4OTPANjihJaufeDNk7AuA0xRPIhSU", - "5ZMD/9N/9ydsloqiGd7/OnHpB5O11qU6mM8vLy9nYZf5Ck1xiRZVup77efpPa50c16HRNqUVd9RGvRpS", - "wE11pHCI396/OT0jhyfHs4ZgJgeTvdnebB8fzimB05JNDibP8Cc8PWvc97kjtsnB5+vpZL4GmqPnyvxR", - "gJYs9Z/UJV2tQM5cJXTz08XTuRea5p+dGfJ627d5WFRw/rllrc129MS6a/PPPp14e+tWvq6zUgcdRkIx", - "PKV9PHb+GYX2wd/nqB9Zcpx770K8ZQvgz/qKZdfdHu65xvnn5v3Ua3tec4j5EmxQPQ2eW50SpgldCIkp", - "tTpdmyPqc/mYaj+3W9PbcWbozPR6Xb8lG5QxOvjQUy3sQMSPhIfSUFxzZlozNWxRywrCyjo102+1b1j/", - "h73k1afP+9P9veu/Gdbu/nzx7HqkU/B18xTtac23Rzb8hIlwaN7Eo/R0b+8OLy0d8vBdXNyk4EGv6PPY", - "VZkUQyYDt1WdgUiNjB0JO53hBx7jfH7DFW81wrRCcCIPJ3xDM+LzTHDu/Yeb+5ijS9awWGKvkOvp5MVD", - "rv6Y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5kG8wuJRlRozTrAAjUtW8znT22RBN2LMZoXmSecU4ToCsAmexRa9pkJGm", + "IBXcPmDa8bU5yN5ZnTDGZH+vADmaw42DcTJtOVvcNkZKTN9Z/ur7Rq632NKRKmxEeD8eo36itPX3/JIy", + "nSyFdNmqiL5+Zw00n7tSXp1fm7IUvS9YayP4MQjsiP86r59kiH7sBq/EvrqIEd+oiU4Lo71wg+s4rw+f", + "zD5hRV+3903w0sF8jilea6H0fHI9/dwJbAo/fqq35nN9Lbstuv50/X8DAAD//50wp92LvAAA", } // GetSwagger returns the Swagger specification corresponding to the generated code diff --git a/daemon/algod/api/server/v2/generated/private/types.go b/daemon/algod/api/server/v2/generated/private/types.go index 8221e7731..1eaa4b4c8 100644 --- a/daemon/algod/api/server/v2/generated/private/types.go +++ b/daemon/algod/api/server/v2/generated/private/types.go @@ -460,26 +460,29 @@ type StateDelta []EvalDeltaKeyValue type StateProof struct { // Represents the message that the state proofs are attesting to. - Message struct { + Message StateProofMessage `json:"Message"` - // The vector commitment root on all light block headers within a state proof interval. - BlockHeadersCommitment []byte `json:"BlockHeadersCommitment"` + // The encoded StateProof for the message. + StateProof []byte `json:"StateProof"` +} - // The first round the message attests to. - FirstAttestedRound uint64 `json:"FirstAttestedRound"` +// StateProofMessage defines model for StateProofMessage. +type StateProofMessage struct { - // The last round the message attests to. - LastAttestedRound uint64 `json:"LastAttestedRound"` + // The vector commitment root on all light block headers within a state proof interval. + BlockHeadersCommitment []byte `json:"BlockHeadersCommitment"` - // An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. - LnProvenWeight uint64 `json:"LnProvenWeight"` + // The first round the message attests to. + FirstAttestedRound uint64 `json:"FirstAttestedRound"` - // The vector commitment root of the top N accounts to sign the next StateProof. - VotersCommitment []byte `json:"VotersCommitment"` - } `json:"Message"` + // The last round the message attests to. + LastAttestedRound uint64 `json:"LastAttestedRound"` - // The encoded StateProof for the message. - StateProof []byte `json:"StateProof"` + // An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. + LnProvenWeight uint64 `json:"LnProvenWeight"` + + // The vector commitment root of the top N accounts to sign the next StateProof. + VotersCommitment []byte `json:"VotersCommitment"` } // TealKeyValue defines model for TealKeyValue. diff --git a/daemon/algod/api/server/v2/generated/routes.go b/daemon/algod/api/server/v2/generated/routes.go index 185fbbca1..f8fc80514 100644 --- a/daemon/algod/api/server/v2/generated/routes.go +++ b/daemon/algod/api/server/v2/generated/routes.go @@ -982,89 +982,89 @@ var swaggerSpec = []string{ "TmGzZ+XvdEV5U/OnfaytCGXXEKTQdnb7Wg0Ccd0nX9oFLK8Fzi+pVE8npRB5MmAuPupXMeiegVOWnkJG", "zN3hY0gGKoGT22ilrP2B56uNz9ovS+CQ3ZkRYtTyotQb7xpsF+TsTM5v6bH51zhrVtnCIk7fn53wePgT", "lvyQV+RvfphxrqbAML8rTmUH2VImYD1QQUHS80hd/F3faow467q1yhuislDEpJRL5ozudL77On+E9INi", - "3ePaT5hS7rM+UyGt6QilJW/Q6QovL4ceOezojf7JzPqcBVMqjKg1TEHZAliiLyQFRgH1tNa145vfV8kx", - "H1pwrBHRV+UVmsawzmKICENn8ozmn18dx0T5Q8SHe80lvtBQnwuRbFGpLud9f0F3mjvQ3a5vav4azQf/", - "CWaPojZNN5SzC9YFyH3dNKwHRHOSi+YhAhySnOOY1gh67zGZuwjLUkLKFOsEn5/7EnC1+oIVUZtHfsb1", - "pW3r/FXoK5CxE3hFSV415aS0QH7XQNic/S8cSDdwcqNUHqO+HllE8DfIfV9vN7kFzxJ4WccR8xdG3Mua", - "5QZLia00TOrcwuhPW3ZgW4iwE4chJFyzPThwQF/QHtxPV911ebgO3NBKQX+dO9+zLdxGrthmbbs6M/rI", - "HfZB6PkuPoh40TTTHZ0gFiFYcZAgqOT9vfdEwgJLigty9y5OcPfu1DV9f7/92TCuu3ejAthnc3+0Xv51", - "88Yo5tehuD0bmzYQItrZj4rl2TbCaAX8NuX9MaT1dxca/UUeGPjd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3WnuQNe9vqn5azS3/CeYPYragN1Qzo5aF2z3deawfhLNSS6ahxtwSHKO", + "Y1qj8b3HZO4iUksJKVOsE6x/7kvm1eoeVpBtHkUa1y+3rfNXoa9Axk5BECV51ZTf0gLvhwbC5oh+YaYy", + "cHKjVB6jvh5ZRPAX41FhauiW6+K0ZU225Qw70RxCwjVblQM39gWtyv2k112Xh+vAS6dS0F/nzrd1C7eR", + "i7pZ264ukT5yhz0Zer6LJyNees10R1eKRQjWLSQIKnl/7z2RsMDC5ILcvYsT3L07dU3f329/Nsf57t2o", + "GPfZnCit94PdvDGK+XUo+s9GuA0Emnb2o2J5to0wWmHDzSMBGBj7uwuw/iLPFPxu7an9o+oKPF/Efdvd", + "BERMZK2tyYOpgoDgHWKBXbdZ9IVnBWklmd5g3rc3v7Hfo/V0fqwt9s7jU2cKurtPi1OoKwc09v1K+dv1", + "R2FfhC6MTI3Oc40vRj1f06LMwR2U727N/x0e/O1htv/g3r/P/7b/aD+Fh4+e7O/TJw/pvScP7sH9vz16", + "uA/3Fo+fzO9n9x/enz+8//Dxoyfpg4f35g8fP/n3W4YPGZAtoBOfZTT5L3zLIzl8fZQcG2AbnNCS1Q/F", + "GTL2ZcRpiicRCsryyYH/6X/7EzZLRdEM73+duCSGyUrrUh3s7Z2fn8/CLntLNOglWlTpas/P03+g6/VR", + "HWBtE2NxR23srCEF3FRHCof47c3zt8fk8PXRrCGYycFkf7Y/u4fP75TAackmB5MH+BOenhXu+54jtsnB", + "h4/Tyd4KaI7+L/NHAVqy1H9S53S5BDlz9dTNT2f397wosffBGTM/mlGXsYx4GyoexAf3y4w7xwjG29hQ", + "8FbZTuWqSE7rYq7O1sAzjOC19kHD2mpkHWVN4bajhlH59HVbz+fgt8h7NQu2rGTnacs6isBVemaK2IfV", + "JXEqzWuanoZRskiQ/6xAbhqCcawsLETjC2+6WNpCLct24FkjJsUewYvVa8eZzT4HlFr7FRpOpGUFISQN", + "XzW8cj958u7Do799nOwACDq5FGCa4nua5+/t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uT2R6xIPXzTkf8+1o8s/WJXMHqm4rbAyEJARMxhNaU3q6xPl6F", + "e0QA65BlXe74c9tsm4hRe4t55MnOhfJFZUP9RWTDV4InqO4B9wJJGy1fThbEyovTwH9SP5hnRFlVlaWQ", + "uj7daraTmAaDTuxQShskXCeEpVSnq6rc+4D/wVImH5uiIfY9yD3r2RmTw97aFtcas2fHbIrAtavnOG+T", + "WJCXLJXiEGtyuhtDbZSGohe/5br+PvbSYPR2ETxnHJJC8FjhnZ/x60v8GK36iXFAA50xImuob/eN1xb8", + "HbDa8+zC3K6K369EAb2SBaSzWgllHfeMVgek/+a0tJ5daI5J6+e9D60/nQPWtVSrSmfiPOiLSpI997s4", + "aILKnTurOo1y0amAqUgGylDXt2dDCfAQI+36a6R0SlCfdbB6yl/UqrJgPOsQCUpvqTgDqWqlX34lvtI/", + "i2lld5QHTKNS2/hEpa73Qn4lMrDjtgvaxbJYuMjAFQHr38O1qBHXWD1Tbtp1dIiUVsuVJlVJtIhpK03H", + "hKaWddnnTtS29yFsK18H/QwIzSXQbEPmAJyIuVl0+50dQhW+xuNVHidQxZ85aOAqpUhBKciS8G3sMdDq", + "0mqoIOkRPCHgCHA9C1GCLKi8JLBWshgHVHdCy2twa3+lEx76UO82/dgGdicPt5FKIP4CQ4uHKMocnM0j", + "gsIdcYIqOfvE++cnuez2VSU+vxx5qMN+PWYF3n+ccqEgFTxTw8/pbDu2WDI6WIsyKwhOSvRVWzPwgDz+", + "girtXv9uvToQlKY2U4y8/zNUFtWM/GtdFLU3dmr4JVeVah5GtyoaZLE1cFiPzPUK1vVcaAf3Y9c6oBak", + "UrBt5CEsBePXT6UHD/rowMqNhaP7i8NUXOr0tz4qW0A0iBgD5K1vFWA3tMAOAILPqZahBO5ej2jgmguR", + "A+XWlCbK0pw/nVS87jeEpre29aH+pWnbJy6Xwoh8PROgQv3cQX5uMaswznFFFXFwkIKeOhV+6TIJ+zCb", + "w5igtyoZo3xzLN+aVuER2HJIu7piePxb56xzODr0Gy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bedLlKYR7/mHnE7uRlJGtONrwZR4C0", + "kkxv8IajJfv9FMz/3xk+rkCe+cuvkvnkYLLSujzY28NX11ZC6b2JuZqab6rz0dwPdGlHcJdLKdkZvtjw", + "7uP/DwAA///T+v88UiwBAA==", } // GetSwagger returns the Swagger specification corresponding to the generated code diff --git a/daemon/algod/api/server/v2/generated/types.go b/daemon/algod/api/server/v2/generated/types.go index db3bd074e..c3d71a7aa 100644 --- a/daemon/algod/api/server/v2/generated/types.go +++ b/daemon/algod/api/server/v2/generated/types.go @@ -460,26 +460,29 @@ type StateDelta []EvalDeltaKeyValue type StateProof struct { // Represents the message that the state proofs are attesting to. - Message struct { + Message StateProofMessage `json:"Message"` - // The vector commitment root on all light block headers within a state proof interval. - BlockHeadersCommitment []byte `json:"BlockHeadersCommitment"` + // The encoded StateProof for the message. + StateProof []byte `json:"StateProof"` +} - // The first round the message attests to. - FirstAttestedRound uint64 `json:"FirstAttestedRound"` +// StateProofMessage defines model for StateProofMessage. +type StateProofMessage struct { - // The last round the message attests to. - LastAttestedRound uint64 `json:"LastAttestedRound"` + // The vector commitment root on all light block headers within a state proof interval. + BlockHeadersCommitment []byte `json:"BlockHeadersCommitment"` - // An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. - LnProvenWeight uint64 `json:"LnProvenWeight"` + // The first round the message attests to. + FirstAttestedRound uint64 `json:"FirstAttestedRound"` - // The vector commitment root of the top N accounts to sign the next StateProof. - VotersCommitment []byte `json:"VotersCommitment"` - } `json:"Message"` + // The last round the message attests to. + LastAttestedRound uint64 `json:"LastAttestedRound"` - // The encoded StateProof for the message. - StateProof []byte `json:"StateProof"` + // An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. + LnProvenWeight uint64 `json:"LnProvenWeight"` + + // The vector commitment root of the top N accounts to sign the next StateProof. + VotersCommitment []byte `json:"VotersCommitment"` } // TealKeyValue defines model for TealKeyValue. diff --git a/test/e2e-go/cli/goal/expect/catchpointCatchupWebProxy/webproxy.go b/test/e2e-go/cli/goal/expect/catchpointCatchupWebProxy/webproxy.go index 335d5bafb..8c574c4b1 100644 --- a/test/e2e-go/cli/goal/expect/catchpointCatchupWebProxy/webproxy.go +++ b/test/e2e-go/cli/goal/expect/catchpointCatchupWebProxy/webproxy.go @@ -28,6 +28,7 @@ import ( "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/test/framework/fixtures" ) @@ -49,14 +50,15 @@ func main() { return } var mu deadlock.Mutex - wp, err := fixtures.MakeWebProxy(*webProxyDestination, func(response http.ResponseWriter, request *http.Request, next http.HandlerFunc) { + log := logging.Base() + wp, err := fixtures.MakeWebProxy(*webProxyDestination, log, func(response http.ResponseWriter, request *http.Request, next http.HandlerFunc) { mu.Lock() time.Sleep(time.Duration(*webProxyRequestDelay) * time.Millisecond) mu.Unlock() // prevent requests for block #2 to go through. if strings.HasSuffix(request.URL.String(), "/block/2") { - response.Write([]byte("webProxy prevents block 2 from serving")) response.WriteHeader(http.StatusBadRequest) + response.Write([]byte("webProxy prevents block 2 from serving")) return } if *webProxyLogFile != "" { diff --git a/test/e2e-go/features/catchup/catchpointCatchup_test.go b/test/e2e-go/features/catchup/catchpointCatchup_test.go index 98efc0b26..e5eba0e97 100644 --- a/test/e2e-go/features/catchup/catchpointCatchup_test.go +++ b/test/e2e-go/features/catchup/catchpointCatchup_test.go @@ -18,7 +18,6 @@ package catchup import ( "fmt" - generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "net/http" "os/exec" "path/filepath" @@ -32,6 +31,9 @@ import ( "github.com/algorand/go-algorand/config" algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" + generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" + "github.com/algorand/go-algorand/data/basics" + "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/nodecontrol" "github.com/algorand/go-algorand/protocol" @@ -116,11 +118,11 @@ func TestBasicCatchpointCatchup(t *testing.T) { // Overview of this test: // Start a two-node network (primary has 100%, secondary has 0%) - // Nodes are having a consensus allowing balances history of 32 rounds and transaction history of 33 rounds. - // Let it run for 37 rounds. - // create a web proxy, and connect it to the primary node, blocking all requests for round #1. ( and allowing everything else ) - // start a secondary node, and instuct it to catchpoint catchup from the proxy. ( which would be for round 36 ) - // wait until the clone node cought up, skipping the "impossible" hole of round #1. + // Nodes are having a consensus allowing balances history of 8 rounds and transaction history of 13 rounds. + // Let it run for 21 rounds. + // create a web proxy, and connect it to the primary node, blocking all requests for round #2. ( and allowing everything else ) + // start a secondary node, and instuct it to catchpoint catchup from the proxy. ( which would be for round 20 ) + // wait until the clone node cought up, skipping the "impossible" hole of round #2. consensus := make(config.ConsensusProtocols) const consensusCatchpointCatchupTestProtocol = protocol.ConsensusVersion("catchpointtestingprotocol") @@ -129,9 +131,9 @@ func TestBasicCatchpointCatchup(t *testing.T) { // MaxBalLookback = 2 x SeedRefreshInterval x SeedLookback // ref. https://github.com/algorandfoundation/specs/blob/master/dev/abft.md catchpointCatchupProtocol.SeedLookback = 2 - catchpointCatchupProtocol.SeedRefreshInterval = 8 - catchpointCatchupProtocol.MaxBalLookback = 2 * catchpointCatchupProtocol.SeedLookback * catchpointCatchupProtocol.SeedRefreshInterval // 32 - catchpointCatchupProtocol.MaxTxnLife = 33 + catchpointCatchupProtocol.SeedRefreshInterval = 2 + catchpointCatchupProtocol.MaxBalLookback = 2 * catchpointCatchupProtocol.SeedLookback * catchpointCatchupProtocol.SeedRefreshInterval // 8 + catchpointCatchupProtocol.MaxTxnLife = 13 catchpointCatchupProtocol.CatchpointLookback = catchpointCatchupProtocol.MaxBalLookback catchpointCatchupProtocol.EnableOnlineAccountCatchpoints = true @@ -161,13 +163,16 @@ func TestBasicCatchpointCatchup(t *testing.T) { // prepare it's configuration file to set it to generate a catchpoint every 4 rounds. cfg, err := config.LoadConfigFromDisk(primaryNode.GetDataDir()) a.NoError(err) - cfg.CatchpointInterval = 4 + const catchpointInterval = 4 + cfg.CatchpointInterval = catchpointInterval cfg.MaxAcctLookback = 2 cfg.SaveToDisk(primaryNode.GetDataDir()) cfg.Archival = false + cfg.CatchpointInterval = 0 cfg.NetAddress = "" cfg.EnableLedgerService = false cfg.EnableBlockService = false + cfg.BaseLoggerDebugLevel = uint32(logging.Debug) cfg.SaveToDisk(secondNode.GetDataDir()) // start the primary node @@ -180,10 +185,15 @@ func TestBasicCatchpointCatchup(t *testing.T) { ExitErrorCallback: errorsCollector.nodeExitWithError, }) a.NoError(err) + defer primaryNode.StopAlgod() // Let the network make some progress currentRound := uint64(1) - const targetRound = uint64(37) + expectedBlocksToDownload := catchpointCatchupProtocol.MaxTxnLife + catchpointCatchupProtocol.DeeperBlockHeaderHistory + const restrictedBlock = 2 // block number that is rejected to be downloaded to ensure fast catchup and not regular catchup is running + // calculate the target round: this is the next round after catchpoint that is greater than expectedBlocksToDownload before the restrictedBlock block number + targetCatchpointRound := (basics.Round(expectedBlocksToDownload+restrictedBlock)/catchpointInterval + 1) * catchpointInterval + targetRound := uint64(targetCatchpointRound) + 1 // 21 primaryNodeRestClient := fixture.GetAlgodClientForController(primaryNode) primaryNodeRestClient.SetAPIVersionAffinity(algodclient.APIVersionV2) log.Infof("Building ledger history..") @@ -194,16 +204,17 @@ func TestBasicCatchpointCatchup(t *testing.T) { break } currentRound++ - } log.Infof("done building!\n") + primaryListeningAddress, err := primaryNode.GetListeningAddress() a.NoError(err) - wp, err := fixtures.MakeWebProxy(primaryListeningAddress, func(response http.ResponseWriter, request *http.Request, next http.HandlerFunc) { + wp, err := fixtures.MakeWebProxy(primaryListeningAddress, log, func(response http.ResponseWriter, request *http.Request, next http.HandlerFunc) { // prevent requests for block #2 to go through. if request.URL.String() == "/v1/test-v1/block/2" { response.WriteHeader(http.StatusBadRequest) + response.Write([]byte("webProxy prevents block 2 from serving")) return } next(response, request) @@ -222,6 +233,7 @@ func TestBasicCatchpointCatchup(t *testing.T) { ExitErrorCallback: errorsCollector.nodeExitWithError, }) a.NoError(err) + defer secondNode.StopAlgod() // wait until node is caught up. secondNodeRestClient := fixture.GetAlgodClientForController(secondNode) @@ -240,10 +252,32 @@ func TestBasicCatchpointCatchup(t *testing.T) { } log.Infof(" - done catching up!\n") - status, err := awaitCatchpointCreation(primaryNodeRestClient, &fixture, 3) - a.NoError(err) + // ensure the catchpoint is created for targetCatchpointRound + var status generatedV2.NodeStatusResponse + timer := time.NewTimer(10 * time.Second) +outer: + for { + status, err = primaryNodeRestClient.Status() + a.NoError(err) - log.Infof("primary node latest catchpoint - %s!\n", status.LastCatchpoint) + var round basics.Round + if status.LastCatchpoint != nil && len(*status.LastCatchpoint) > 0 { + round, _, err = ledgercore.ParseCatchpointLabel(*status.LastCatchpoint) + a.NoError(err) + if round >= targetCatchpointRound { + break + } + } + select { + case <-timer.C: + a.Failf("timeout waiting a catchpoint", "target: %d, got %d", targetCatchpointRound, round) + break outer + default: + time.Sleep(250 * time.Millisecond) + } + } + + log.Infof("primary node latest catchpoint - %s!\n", *status.LastCatchpoint) _, err = secondNodeRestClient.Catchup(*status.LastCatchpoint) a.NoError(err) @@ -260,9 +294,6 @@ func TestBasicCatchpointCatchup(t *testing.T) { currentRound++ } log.Infof("done catching up!\n") - - secondNode.StopAlgod() - primaryNode.StopAlgod() } func TestCatchpointLabelGeneration(t *testing.T) { @@ -295,9 +326,9 @@ func TestCatchpointLabelGeneration(t *testing.T) { // MaxBalLookback = 2 x SeedRefreshInterval x SeedLookback // ref. https://github.com/algorandfoundation/specs/blob/master/dev/abft.md catchpointCatchupProtocol.SeedLookback = 2 - catchpointCatchupProtocol.SeedRefreshInterval = 8 - catchpointCatchupProtocol.MaxBalLookback = 2 * catchpointCatchupProtocol.SeedLookback * catchpointCatchupProtocol.SeedRefreshInterval // 32 - catchpointCatchupProtocol.MaxTxnLife = 33 + catchpointCatchupProtocol.SeedRefreshInterval = 2 + catchpointCatchupProtocol.MaxBalLookback = 2 * catchpointCatchupProtocol.SeedLookback * catchpointCatchupProtocol.SeedRefreshInterval // 8 + catchpointCatchupProtocol.MaxTxnLife = 13 catchpointCatchupProtocol.CatchpointLookback = catchpointCatchupProtocol.MaxBalLookback catchpointCatchupProtocol.EnableOnlineAccountCatchpoints = true @@ -338,10 +369,11 @@ func TestCatchpointLabelGeneration(t *testing.T) { ExitErrorCallback: errorsCollector.nodeExitWithError, }) a.NoError(err) + defer primaryNode.StopAlgod() // Let the network make some progress currentRound := uint64(1) - targetRound := uint64(41) + targetRound := uint64(21) primaryNodeRestClient := fixture.GetAlgodClientForController(primaryNode) primaryNodeRestClient.SetAPIVersionAffinity(algodclient.APIVersionV2) log.Infof("Building ledger history..") @@ -364,7 +396,6 @@ func TestCatchpointLabelGeneration(t *testing.T) { } else { a.Empty(*primaryNodeStatus.LastCatchpoint) } - primaryNode.StopAlgod() }) } } diff --git a/test/e2e-go/features/stateproofs/stateproofs_test.go b/test/e2e-go/features/stateproofs/stateproofs_test.go index 5ad6f4998..8fdcfe31f 100644 --- a/test/e2e-go/features/stateproofs/stateproofs_test.go +++ b/test/e2e-go/features/stateproofs/stateproofs_test.go @@ -21,6 +21,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "sync" "sync/atomic" "testing" @@ -111,7 +112,11 @@ func TestStateProofs(t *testing.T) { var fixture fixtures.RestClientFixture fixture.SetConsensus(configurableConsensus) - fixture.Setup(t, filepath.Join("nettemplates", "StateProof.json")) + if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { + fixture.Setup(t, filepath.Join("nettemplates", "StateProofSmall.json")) + } else { + fixture.Setup(t, filepath.Join("nettemplates", "StateProof.json")) + } defer fixture.Shutdown() verifyStateProofsCreation(t, &fixture, consensusParams) @@ -219,27 +224,33 @@ func TestStateProofOverlappingKeys(t *testing.T) { configurableConsensus[consensusVersion] = consensusParams var fixture fixtures.RestClientFixture + pNodes := 5 fixture.SetConsensus(configurableConsensus) - fixture.Setup(t, filepath.Join("nettemplates", "StateProof.json")) + if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { + fixture.Setup(t, filepath.Join("nettemplates", "StateProofSmall.json")) + pNodes = 2 + } else { + fixture.Setup(t, filepath.Join("nettemplates", "StateProof.json")) + } defer fixture.Shutdown() // Get node libgoal clients in order to update their participation keys - var libgoalNodeClients [5]libgoal.Client - for i := 0; i < 5; i++ { + libgoalNodeClients := make([]libgoal.Client, pNodes, pNodes) + for i := 0; i < pNodes; i++ { nodeName := fmt.Sprintf("Node%d", i) c := fixture.GetLibGoalClientForNamedNode(nodeName) libgoalNodeClients[i] = c } // Get account address of each participating node - var accounts [5]string + accounts := make([]string, pNodes, pNodes) for i, c := range libgoalNodeClients { parts, err := c.GetParticipationKeys() // should have 1 participation per node r.NoError(err) accounts[i] = parts[0].Address } - var participations [5]account.Participation + participations := make([]account.Participation, pNodes, pNodes) var lastStateProofBlock bookkeeping.Block var lastStateProofMessage stateproofmsg.Message libgoalClient := fixture.LibGoalClient @@ -251,14 +262,14 @@ func TestStateProofOverlappingKeys(t *testing.T) { for rnd := uint64(1); rnd <= consensusParams.StateProofInterval*(expectedNumberOfStateProofs+1); rnd++ { if rnd == voteLastValid-64 { // allow some buffer period before the voting keys are expired (for the keyreg to take effect) // Generate participation keys (for the same accounts) - for i := 0; i < 5; i++ { + for i := 0; i < pNodes; i++ { // Overlapping stateproof keys (the key for round 0 is valid up to 256) _, part, err := installParticipationKey(t, libgoalNodeClients[i], accounts[i], 0, 200) r.NoError(err) participations[i] = part } // Register overlapping participation keys - for i := 0; i < 5; i++ { + for i := 0; i < pNodes; i++ { registerParticipationAndWait(t, libgoalNodeClients[i], participations[i]) } } @@ -315,7 +326,11 @@ func TestStateProofMessageCommitmentVerification(t *testing.T) { var fixture fixtures.RestClientFixture fixture.SetConsensus(configurableConsensus) - fixture.Setup(t, filepath.Join("nettemplates", "StateProof.json")) + if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { + fixture.Setup(t, filepath.Join("nettemplates", "StateProofSmall.json")) + } else { + fixture.Setup(t, filepath.Join("nettemplates", "StateProof.json")) + } defer fixture.Shutdown() libgoalClient := fixture.LibGoalClient @@ -439,6 +454,10 @@ func TestRecoverFromLaggingStateProofChain(t *testing.T) { partitiontest.PartitionTest(t) defer fixtures.ShutdownSynchronizedTest(t) + if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { + t.Skip("This test is difficult for ARM") + } + r := require.New(fixtures.SynchronizedTest(t)) configurableConsensus := make(config.ConsensusProtocols) @@ -533,6 +552,10 @@ func TestUnableToRecoverFromLaggingStateProofChain(t *testing.T) { partitiontest.PartitionTest(t) defer fixtures.ShutdownSynchronizedTest(t) + if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { + t.Skip("This test is difficult for ARM") + } + r := require.New(fixtures.SynchronizedTest(t)) configurableConsensus := make(config.ConsensusProtocols) @@ -649,6 +672,10 @@ func TestAttestorsChangeTest(t *testing.T) { partitiontest.PartitionTest(t) defer fixtures.ShutdownSynchronizedTest(t) + if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { + t.Skip("This test is difficult for ARM") + } + a := require.New(fixtures.SynchronizedTest(t)) consensusParams := getDefaultStateProofConsensusParams() @@ -765,7 +792,11 @@ func TestTotalWeightChanges(t *testing.T) { var fixture fixtures.RestClientFixture fixture.SetConsensus(configurableConsensus) - fixture.Setup(t, filepath.Join("nettemplates", "RichAccountStateProof.json")) + if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { + fixture.Setup(t, filepath.Join("nettemplates", "RichAccountStateProofSmall.json")) + } else { + fixture.Setup(t, filepath.Join("nettemplates", "RichAccountStateProof.json")) + } defer fixture.Shutdown() var lastStateProofBlock bookkeeping.Block diff --git a/test/framework/fixtures/webProxyFixture.go b/test/framework/fixtures/webProxyFixture.go index 94cee4ce7..0b9e12d93 100644 --- a/test/framework/fixtures/webProxyFixture.go +++ b/test/framework/fixtures/webProxyFixture.go @@ -17,10 +17,11 @@ package fixtures import ( - "fmt" "net" "net/http" "strings" + + "github.com/algorand/go-algorand/logging" ) // WebProxyInterceptFunc expose the web proxy intercept function @@ -32,16 +33,16 @@ type WebProxy struct { listener net.Listener destination string intercept WebProxyInterceptFunc + log logging.Logger } // MakeWebProxy creates an instance of the web proxy -func MakeWebProxy(destination string, intercept WebProxyInterceptFunc) (wp *WebProxy, err error) { - if strings.HasPrefix(destination, "http://") { - destination = destination[7:] - } +func MakeWebProxy(destination string, log logging.Logger, intercept WebProxyInterceptFunc) (wp *WebProxy, err error) { + destination = strings.TrimPrefix(destination, "http://") wp = &WebProxy{ destination: destination, intercept: intercept, + log: log, } wp.server = &http.Server{ Handler: wp, @@ -63,6 +64,7 @@ func (wp *WebProxy) GetListenAddress() string { // Close release the web proxy resources func (wp *WebProxy) Close() { + wp.log.Debugln("webproxy: quiting") // we can't use shutdown, since we have tunneled websocket, which is a hijacked connection // that http.Server doens't know how to handle. wp.server.Close() @@ -70,7 +72,7 @@ func (wp *WebProxy) Close() { // ServeHTTP serves a single HTTP request func (wp *WebProxy) ServeHTTP(response http.ResponseWriter, request *http.Request) { - //fmt.Printf("incoming request for %v\n", request.URL) + wp.log.Debugf("webproxy: incoming request for %v", request.URL) if wp.intercept == nil { wp.Passthrough(response, request) return @@ -86,7 +88,7 @@ func (wp *WebProxy) Passthrough(response http.ResponseWriter, request *http.Requ clientRequestURL.Host = wp.destination clientRequest, err := http.NewRequest(request.Method, clientRequestURL.String(), request.Body) if err != nil { - fmt.Printf("Passthrough request assembly error %v (%#v)\n", err, clientRequestURL) + wp.log.Debugf("Passthrough request assembly error %v (%#v)", err, clientRequestURL) response.WriteHeader(http.StatusInternalServerError) return } @@ -99,7 +101,7 @@ func (wp *WebProxy) Passthrough(response http.ResponseWriter, request *http.Requ } clientResponse, err := client.Do(clientRequest) if err != nil { - fmt.Printf("Passthrough request error %v (%v)\n", err, request.URL.String()) + wp.log.Debugf("Passthrough request error %v (%v)", err, request.URL.String()) response.WriteHeader(http.StatusInternalServerError) return } diff --git a/test/testdata/nettemplates/RichAccountStateProofSmall.json b/test/testdata/nettemplates/RichAccountStateProofSmall.json new file mode 100644 index 000000000..bd2fd8ee5 --- /dev/null +++ b/test/testdata/nettemplates/RichAccountStateProofSmall.json @@ -0,0 +1,20 @@ +{ + "Genesis": { + "NetworkName": "tbd", + "ConsensusProtocol": "test-fast-stateproofs", + "LastPartKeyRound": 100, + "Wallets": [ + { "Name": "richWallet", "Stake": 99, "Online": true }, + { "Name": "poorWallet", "Stake": 1, "Online": true } + ] + }, + "Nodes": [ + { + "Name": "Relay0", + "IsRelay": true, + "Wallets": [] + }, + { "Name": "richNode", "Wallets": [ { "Name": "richWallet", "ParticipationOnly": false } ] }, + { "Name": "poorNode", "Wallets": [ { "Name": "poorWallet", "ParticipationOnly": false } ] } + ] +} diff --git a/test/testdata/nettemplates/StateProofSmall.json b/test/testdata/nettemplates/StateProofSmall.json new file mode 100644 index 000000000..cfe7d6936 --- /dev/null +++ b/test/testdata/nettemplates/StateProofSmall.json @@ -0,0 +1,20 @@ +{ + "Genesis": { + "NetworkName": "tbd", + "ConsensusProtocol": "test-fast-stateproofs", + "LastPartKeyRound": 100, + "Wallets": [ + { "Name": "Wallet0", "Stake": 50, "Online": true }, + { "Name": "Wallet1", "Stake": 50, "Online": true } + ] + }, + "Nodes": [ + { + "Name": "Relay0", + "IsRelay": true, + "Wallets": [] + }, + { "Name": "Node0", "Wallets": [ { "Name": "Wallet0", "ParticipationOnly": false } ] }, + { "Name": "Node1", "Wallets": [ { "Name": "Wallet1", "ParticipationOnly": false } ] } + ] +} |