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

Incentives: Storing/ serving heartbeat transactions, synthetic transactions for payouts #1635

Merged
merged 8 commits into from
Dec 20, 2024
6 changes: 4 additions & 2 deletions api/converter_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,17 @@ func signedTxnWithAdToTransaction(stxn *sdk.SignedTxnWithAD, extra rowData) (gen
case sdk.HeartbeatTx:
hb := stxn.Txn.HeartbeatTxnFields
hbTxn := generated.TransactionHeartbeat{
HbAddress: hb.HbAddress.String(),
HbAddress: hb.HbAddress.String(),
HbKeyDilution: hb.HbKeyDilution,
jannotti marked this conversation as resolved.
Show resolved Hide resolved
HbProof: generated.HbProofFields{
HbPk: byteSliceOmitZeroPtr(hb.HbProof.PK[:]),
HbPk1sig: byteSliceOmitZeroPtr(hb.HbProof.PK1Sig[:]),
HbPk2: byteSliceOmitZeroPtr(hb.HbProof.PK2[:]),
HbPk2sig: byteSliceOmitZeroPtr(hb.HbProof.PK2Sig[:]),
HbSig: byteSliceOmitZeroPtr(hb.HbProof.Sig[:]),
},
HbSeed: hb.HbSeed[:],
HbSeed: hb.HbSeed[:],
HbVoteId: hb.HbVoteID[:],
}
heartbeat = &hbTxn
}
Expand Down
379 changes: 190 additions & 189 deletions api/generated/common/routes.go

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions api/generated/common/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

457 changes: 229 additions & 228 deletions api/generated/v2/routes.go

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions api/generated/v2/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions api/indexer.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,9 @@
"required": [
"hb-address",
"hb-proof",
"hb-seed"
"hb-seed",
"hb-vote-id",
"hb-key-dilution"
],
"properties": {
"hb-address": {
Expand All @@ -2300,9 +2302,19 @@
"$ref": "#/definitions/HbProofFields"
},
"hb-seed": {
"description": "\\[hbsd\\] HbSeed must be the block seed for the block before this transaction's\n\t// firstValid..",
"description": "\\[hbsd\\] HbSeed must be the block seed for the this transaction's firstValid block.",
"type": "string",
"format": "byte"
},
"hb-vote-id": {
"description": "\\[hbvid\\] HbVoteID must match the HbAddress account's current VoteID.",
"type": "string",
"format": "byte"
},
"hb-key-dilution": {
"description": "\\[hbkd\\] HbKeyDilution must match HbAddress account's current KeyDilution.",
"type": "integer",
"x-algorand-format": "uint64"
}
}
},
Expand Down
17 changes: 15 additions & 2 deletions api/indexer.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2235,20 +2235,33 @@
"description": "\\[hbad\\] HbAddress is the account this txn is proving onlineness for.",
"type": "string"
},
"hb-key-dilution": {
"description": "\\[hbkd\\] HbKeyDilution must match HbAddress account's current KeyDilution.",
"type": "integer",
"x-algorand-format": "uint64"
},
"hb-proof": {
"$ref": "#/components/schemas/HbProofFields"
},
"hb-seed": {
"description": "\\[hbsd\\] HbSeed must be the block seed for the block before this transaction's\n\t// firstValid..",
"description": "\\[hbsd\\] HbSeed must be the block seed for the this transaction's firstValid block.",
"format": "byte",
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
"type": "string"
},
"hb-vote-id": {
"description": "\\[hbvid\\] HbVoteID must match the HbAddress account's current VoteID.",
"format": "byte",
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
"type": "string"
}
},
"required": [
"hb-address",
"hb-key-dilution",
"hb-proof",
"hb-seed"
"hb-seed",
"hb-vote-id"
],
"type": "object"
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.23.3

require (
github.com/algorand/avm-abi v0.2.0
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241127164804-625a18def941
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241211195928-f2700fd860bb
github.com/algorand/go-codec/codec v1.1.10
github.com/algorand/oapi-codegen v1.12.0-algorand.0
github.com/davecgh/go-spew v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/algorand/avm-abi v0.2.0 h1:bkjsG+BOEcxUcnGSALLosmltE0JZdg+ZisXKx0UDX2k=
github.com/algorand/avm-abi v0.2.0/go.mod h1:+CgwM46dithy850bpTeHh9MC99zpn2Snirb3QTl2O/g=
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241127164804-625a18def941 h1:ApRVtpHa4FCd3xt3LUGZNjbuXHUvyOruNPPe9HWyMWU=
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241127164804-625a18def941/go.mod h1:BkHnK2PuCqzdGPNeWUo5yo6lRjyDZ9QoMN8GIjfijrA=
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241211195928-f2700fd860bb h1:p8QGl1ExZ+axyBM1mdxJM4TFbyBmZKpRO4YHoRvj7NQ=
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241211195928-f2700fd860bb/go.mod h1:BkHnK2PuCqzdGPNeWUo5yo6lRjyDZ9QoMN8GIjfijrA=
github.com/algorand/go-codec/codec v1.1.10 h1:zmWYU1cp64jQVTOG8Tw8wa+k0VfwgXIPbnDfiVa+5QA=
github.com/algorand/go-codec/codec v1.1.10/go.mod h1:YkEx5nmr/zuCeaDYOIhlDg92Lxju8tj2d2NrYqP7g7k=
github.com/algorand/oapi-codegen v1.12.0-algorand.0 h1:W9PvED+wAJc+9EeXPONnA+0zE9UhynEqoDs4OgAxKhk=
Expand Down
Loading