-
Notifications
You must be signed in to change notification settings - Fork 509
Incentives: Heartbeat transaction type #6149
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
eb2acd4
Heartbeat transaction type
jannotti 6f3f3c1
Small CI fixups
jannotti 018c8e2
break dependency on transactions package
jannotti c2c7262
linting
jannotti ada8222
Add in the actual heartbeat crypto, simple test of the service
jannotti 79d0701
DoubleLedger tests on heartbeat
jannotti d38d43c
Heartbeat service fixes and test
jannotti 518b65c
Merge remote-tracking branch 'upstream/feature/heartbeats'
jannotti 67d4f93
Merge remote-tracking branch 'upstream/feature/heartbeats' into heart…
jannotti 5191eb5
Code review
jannotti 1f93f49
Test heartbeat service, restrict free heartbeats
jannotti 75f9afb
Add some extra checks on cheap heartbeats
jannotti 674915e
Introduce HeartbeatProof
jannotti ba3c96c
missed a conversion
jannotti 9fa93f0
more conversions
jannotti ffe7045
Bump LastHeartbeat if account receives a lot of money
jannotti cbe9c5b
Update data/transactions/logic/assembler.go
jannotti 2c0975f
First cut
jannotti 71c46a8
Merge remote-tracking branch 'origin/heartbeat' into heartbeat
jannotti d8e3989
CR from @gmalouf
jannotti 974f357
Use firstValid blockseed in heartbeat
jannotti 1cb12d3
Adjust tests and readme for signing FirstValid seed
jannotti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (C) 2019-2024 Algorand, Inc. | ||
// This file is part of go-algorand | ||
// | ||
// go-algorand is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as | ||
// published by the Free Software Foundation, either version 3 of the | ||
// License, or (at your option) any later version. | ||
// | ||
// go-algorand is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with go-algorand. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
package transactions | ||
|
||
import ( | ||
"github.com/algorand/go-algorand/crypto" | ||
"github.com/algorand/go-algorand/data/basics" | ||
"github.com/algorand/go-algorand/data/committee" | ||
) | ||
|
||
// HeartbeatTxnFields captures the fields used for an account to prove it is | ||
// online (really, it proves that an entity with the account's part keys is able | ||
// to submit transactions, so it should be able to propose/vote.) | ||
type HeartbeatTxnFields struct { | ||
_struct struct{} `codec:",omitempty,omitemptyarray"` | ||
|
||
// HeartbeatAddress is the account this txn is proving onlineness for. | ||
HbAddress basics.Address `codec:"hbad"` | ||
|
||
// HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online. | ||
HbProof crypto.OneTimeSignature `codec:"hbprf"` | ||
|
||
// HbSeed must be the block seed for the block before this transaction's | ||
// firstValid. It is supplied in the transaction so that Proof can be | ||
// checked at submit time without a ledger lookup, and must be checked at | ||
// evaluation time for equality with the actual blockseed. | ||
HbSeed committee.Seed `codec:"hbsd"` | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.