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

Feature: EFM Recovery, Protocol HCU (core-contracts) #465

Open
wants to merge 174 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
c97e2f0
update to view functions for stable cadence
joshuahannan Nov 2, 2022
e39f87c
Update to newest Stable Cadence Preview (#371)
dsainati1 Jul 5, 2023
309e602
remove casting and fix conflicts
joshuahannan Jul 10, 2023
08c37b8
integrate ft and nft stable cadence changes, use access, view, and en…
joshuahannan Jul 18, 2023
345c81b
use v2 ft and nft
joshuahannan Jul 18, 2023
2de1c22
use string for nft import
joshuahannan Jul 18, 2023
d70590b
update token deps
joshuahannan Jul 18, 2023
861a1c4
update token deps
joshuahannan Jul 18, 2023
6c7e2e5
update nft dependecy
joshuahannan Jul 18, 2023
9005af3
update nft dep
joshuahannan Jul 18, 2023
34953f6
update ft dep
joshuahannan Jul 18, 2023
6044078
add more view
joshuahannan Jul 19, 2023
bcdf82c
update FlowToken contract getter to explicitly use metadata views
joshuahannan Jul 19, 2023
b1cdfb9
implement new standard methods
joshuahannan Jul 19, 2023
5c9dbc1
update nft dependency
joshuahannan Jul 19, 2023
b8f0e9e
update ft dep
joshuahannan Jul 19, 2023
15d02eb
fix FungibleToken.Vault types and imports
joshuahannan Jul 19, 2023
46b6929
remove view from copy
joshuahannan Jul 19, 2023
a9f8e5f
add correct vault type
joshuahannan Jul 19, 2023
492674f
remove views and update balances
joshuahannan Jul 19, 2023
971b709
use vault interface type
joshuahannan Jul 19, 2023
f1f8764
remove restricted types
joshuahannan Jul 26, 2023
3e8c398
remove AnyStruct
joshuahannan Jul 26, 2023
9fd65f4
remove type restrictions
joshuahannan Jul 26, 2023
b977889
fix view modifiers in epoch contracts
joshuahannan Jul 27, 2023
f16eaec
use setter methods in QC
joshuahannan Jul 27, 2023
70bc6fd
remove pub from QC
joshuahannan Jul 27, 2023
57ec160
remove restricted types from flow epoch
joshuahannan Jul 27, 2023
692c1cf
use setters in FlowEpoch
joshuahannan Jul 27, 2023
47187b3
correct metadata types
joshuahannan Jul 27, 2023
1fc8536
use UInt64 in NodeVersionBeacon
joshuahannan Jul 27, 2023
02c1131
replace addresses and fix transactions and scripts
joshuahannan Aug 2, 2023
f2fe0ac
fixes to epoch tests
joshuahannan Aug 8, 2023
da1b7b5
update to latest token standards and update locked tokens transactions
joshuahannan Aug 22, 2023
c7e0170
Update contracts
SupunS Sep 8, 2023
722ec7b
Update more contracts
SupunS Sep 11, 2023
9564e5d
Update contracts
SupunS Sep 11, 2023
81aa739
Update contarcts and transactions
SupunS Sep 12, 2023
4c50f6c
go mod tidy
SupunS Sep 12, 2023
d052c5c
Update flow-sdk
SupunS Sep 12, 2023
bf077d0
Update more contracts
SupunS Sep 12, 2023
fb8fc84
Update ft/nft deps
SupunS Sep 13, 2023
2334795
Generate assets
SupunS Sep 13, 2023
82a613c
Update more cadence codes
SupunS Sep 13, 2023
6401295
Fix typo
SupunS Sep 14, 2023
370407f
Replace get()+borrow() with borrow()
SupunS Sep 14, 2023
6a99037
Refactor code
SupunS Sep 14, 2023
fd33ce2
Update go-sdk and flow-nft versions
SupunS Sep 15, 2023
1cf8b4c
Fix publish_voter transaction
SupunS Sep 18, 2023
0aef25b
Update to Cadence v1.0.0-preview.1
SupunS Sep 21, 2023
448d648
Apply suggestions from code review
SupunS Sep 21, 2023
d49fd04
Refactor code
SupunS Sep 22, 2023
ce228e8
fix and improve syntax
turbolent Sep 22, 2023
3b4c47c
use optional chaining and nil-coaelescing instead of force-unwrapping
turbolent Sep 22, 2023
19a5688
Update get_total_balance.cdc
SupunS Sep 26, 2023
b373ce8
make sure epoch contracts work with capability controllers and entitl…
joshuahannan Nov 22, 2023
298f47d
update dependencies and add public burn tokens method
joshuahannan Dec 4, 2023
20e6057
remove view from getRandomSourceHistoryPage and use account.storage
joshuahannan Dec 11, 2023
99ff402
remove custom destructors and fix entitlement usage
joshuahannan Dec 12, 2023
761f879
get all go tests passing for cadence 1.0
joshuahannan Jan 2, 2024
3f33ef0
make ci
joshuahannan Jan 2, 2024
6edd0e3
make ci
joshuahannan Jan 2, 2024
40e8ef0
update cli version for CI
joshuahannan Jan 2, 2024
c4d2acb
update go version
joshuahannan Jan 3, 2024
8094b24
update Withdrawable and createEmptyVault
joshuahannan Jan 23, 2024
0c5bccb
Update Cadence version (#406)
SupunS Jan 23, 2024
6430730
update createEmpty in staking
joshuahannan Jan 24, 2024
1376f64
use Burner and update dependencies
joshuahannan Jan 25, 2024
c4cacb0
update to SDK v1.0.0-M1
turbolent Jan 25, 2024
b0d86ba
update NFT contracts, remove replace statements
turbolent Jan 25, 2024
762d6d2
update to Cadence v1.0.0-M3
turbolent Jan 25, 2024
ad07d0e
update to Cadence v1.0.0-M3 and SDK v1.0.0-M1
turbolent Jan 25, 2024
04dae1a
remove getBalance, add isAvailableToWithdraw
joshuahannan Jan 25, 2024
61d01ea
update ft and nft deps
joshuahannan Feb 1, 2024
9974772
update emulator dependencies and get tests passing
joshuahannan Feb 1, 2024
639f419
use FungibleToken.Balance instead of FlowToken.Vault
joshuahannan Feb 1, 2024
5c18b63
use correct public path types
joshuahannan Feb 5, 2024
23e5224
update imports
joshuahannan Feb 6, 2024
9f926bf
go mod tidy
joshuahannan Feb 6, 2024
d795124
add fungible token switchboard
joshuahannan Feb 6, 2024
d9617df
fix switchboard
joshuahannan Feb 6, 2024
006447b
update error messages for ledger transactions
joshuahannan Feb 7, 2024
47f3354
add updated manifests with new account, FT, and NFT transactions and …
joshuahannan Feb 9, 2024
b56d319
update account transactions to use simple arguments
joshuahannan Feb 12, 2024
1533936
update manifest to include both styles of token transfer transactions:
joshuahannan Feb 13, 2024
96d94e2
use string args for NFT contracts
joshuahannan Feb 14, 2024
59a36e0
update collection machine account transactions to not use keylist entry
joshuahannan Feb 15, 2024
426ec6e
Update contract getter methods to use env (#410)
joshuahannan Feb 27, 2024
594be1e
get address replacement working in tests and add event emission restr…
joshuahannan Feb 27, 2024
9fab58a
update to latest emulator, cadence, and token standards versions
joshuahannan Mar 5, 2024
aecc7fb
Update README
joshuahannan Mar 7, 2024
5c41345
Don't copy dictionary in getEpochMetadata (#413)
janezpodhostnik Mar 22, 2024
12c392c
update NFT contracts
joshuahannan Mar 26, 2024
26f74bc
update ft dependency
joshuahannan Mar 27, 2024
e100822
update token standard dependencies
joshuahannan Apr 2, 2024
02924cc
make ci
joshuahannan Apr 2, 2024
c53fc79
fix algorithm typo and test names
joshuahannan Apr 8, 2024
9eaaa39
update nft transactions
joshuahannan Apr 9, 2024
7abc82a
update FlowEpoch contract
kc1116 Apr 12, 2024
7fe14e1
generate assets
kc1116 Apr 12, 2024
5791ea4
happy path tests
kc1116 Apr 12, 2024
4fa05d5
Update flow_epoch_test.go
kc1116 Apr 12, 2024
c256d3c
upgrade changes to be compliant with cadence 1.0
kc1116 Apr 15, 2024
11e2b2d
generate assets
kc1116 Apr 12, 2024
836e726
happy path tests
kc1116 Apr 12, 2024
cb277e5
remove unused stakingEndView param
kc1116 Apr 26, 2024
500fb52
cant use timing config in epoch recover
kc1116 Apr 26, 2024
4fbd4aa
add epoch counter comment
kc1116 Apr 26, 2024
ad2df49
move save epoch metadata to ending of recover func add comment
kc1116 Apr 26, 2024
505a371
Update FlowEpoch.cdc
kc1116 Apr 26, 2024
f2818d8
Update contracts/epochs/FlowEpoch.cdc
kc1116 Apr 25, 2024
5e2f861
Update contracts/epochs/FlowEpoch.cdc
kc1116 Apr 26, 2024
dfd8e2f
update assets
kc1116 Apr 26, 2024
5d5fb6e
Apply suggestions from code review
kc1116 May 13, 2024
5b92b6e
reuse old var names
kc1116 May 15, 2024
6a2bdb5
remove RecoverEpochMetadata
kc1116 May 15, 2024
caa0040
use named parameters
kc1116 May 15, 2024
a667862
use separate var for long lines, remove casts
kc1116 May 15, 2024
97baba8
generate assets
kc1116 May 15, 2024
926626a
use common.AddressLocation
kc1116 May 15, 2024
8ae7e38
add separate funcs recover new epoch and recover current epoch
kc1116 May 28, 2024
3ce24c2
- dont generate a new random source when overwriting the epoch metadata
kc1116 Jun 20, 2024
548f22f
fix typos in transactions
joshuahannan Apr 15, 2024
66a7ba9
update nft dependencies
joshuahannan Apr 15, 2024
ac40215
Add entitlement for locked account creator (#423)
joshuahannan Apr 24, 2024
677b20d
update ft dependencies
joshuahannan Apr 24, 2024
d289b84
update nft imports and remove unnecessary Burner import from FlowToken
joshuahannan Apr 29, 2024
fed5e86
update dependencies
joshuahannan May 7, 2024
46a4cac
address PR comments and add entitlements to LockedTokens.TokenManager
joshuahannan May 9, 2024
81b3d68
remove UseTokens entitlement
joshuahannan May 9, 2024
0f711ea
use view more and update nft deps
joshuahannan May 17, 2024
99b721f
make ci
joshuahannan May 17, 2024
63df092
merge master
kc1116 Jun 20, 2024
b912dae
update assets
kc1116 Jun 20, 2024
20115f7
merge master
kc1116 Jun 20, 2024
4d826d5
update changes from master
kc1116 Jun 20, 2024
59905bb
update changes from master
kc1116 Jun 20, 2024
f893516
Update random_beacon_history_test.cdc
kc1116 Jun 20, 2024
52f8c36
fix whitespace
kc1116 Jun 20, 2024
3e09ba0
Update ci.yml
kc1116 Jun 20, 2024
3da8cf5
update assets
kc1116 Jun 20, 2024
967aae8
update test helpers
kc1116 Jun 20, 2024
88f0a28
reference event from parent scope
kc1116 Jun 22, 2024
d8135eb
use aggregatedSignature
kc1116 Jul 10, 2024
c15443c
Update contracts/epochs/FlowClusterQC.cdc
kc1116 Jul 22, 2024
71ef9e2
Apply suggestions from code review
kc1116 Jul 22, 2024
be37706
Sync `feature/efm-recovery` with `master` (#437)
jordanschalm Jul 25, 2024
118967a
Merge branch 'feature/efm-recovery' into khalil/5639-epoch-recovery-t…
jordanschalm Jul 25, 2024
6d88321
make generate
jordanschalm Jul 25, 2024
768787d
Merge branch 'master' into feature/efm-recovery
jordanschalm Jul 28, 2024
4a4524c
Merge branch 'feature/efm-recovery' into khalil/5639-epoch-recovery-t…
jordanschalm Jul 28, 2024
5aafe7f
tidy
jordanschalm Jul 28, 2024
66fa3f4
document TestEpochRecover
kc1116 Jul 29, 2024
61f07b6
remove unused dkg qc txs
kc1116 Jul 29, 2024
a78b7d7
add sanity check to ensure we receive vote data for each cluster
kc1116 Jul 29, 2024
614f489
ensure curEpochCounter = startEpochCounter+1
kc1116 Jul 29, 2024
8b5087d
check counter and epoch metadata after second recover transaction
kc1116 Jul 29, 2024
1e41ecf
provide recovery epoch counter in recover epoch transaction
kc1116 Jul 29, 2024
ec8c94d
Update contracts/epochs/FlowEpoch.cdc
kc1116 Jul 29, 2024
88d6cda
Update contracts/epochs/FlowEpoch.cdc
kc1116 Jul 29, 2024
19a3795
add new line
kc1116 Jul 29, 2024
d342f4e
Update flow_epoch_test.go
kc1116 Jul 29, 2024
d332997
Merge branch 'khalil/5639-epoch-recovery-transaction' of github.com:o…
kc1116 Jul 29, 2024
802d828
remove state changes from prechecks func add new func stop epoch comp…
kc1116 Jul 29, 2024
1f63515
use access self on admin commands
kc1116 Jul 29, 2024
3118243
Merge pull request #420 from onflow/khalil/5639-epoch-recovery-transa…
kc1116 Jul 29, 2024
5ac5c9b
Revert "EpochRecover service event and transaction"
kc1116 Jul 30, 2024
29583d4
Merge pull request #438 from onflow/revert-420-khalil/5639-epoch-reco…
kc1116 Jul 30, 2024
8e0fe4b
Merge branch 'master' into feature/efm-recovery
jordanschalm Sep 13, 2024
2533ece
Add node ID to index mapping to DKG data model (#441)
jordanschalm Oct 15, 2024
8595395
Merge branch 'master' into feature/efm-recovery
jordanschalm Oct 15, 2024
872ffe7
EFM Recovery Service Event and Transaction (#440)
kc1116 Oct 25, 2024
4facd67
Merge branch 'master' into feature/efm-recovery
jordanschalm Oct 28, 2024
807cf69
Add `ProtocolStateVersionUpgrade` service event (#464)
jordanschalm Oct 29, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
- name: Install Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
- name: Run Go and Cadence tests
run: make ci
run: make ci
36 changes: 32 additions & 4 deletions contracts/NodeVersionBeacon.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
/// The contract itself can be used to query the current version and the next upcoming version.
access(all) contract NodeVersionBeacon {

/// =========================
/// Execution State Versioning
/// =========================

/// Struct representing software version as Semantic Version
/// along with helper functions
/// For reference, see https://semver.org/
Expand Down Expand Up @@ -134,10 +138,11 @@ access(all) contract NodeVersionBeacon {
)
}

/// Event emitted when the version table is updated.
/// It contains the current version and all the upcoming versions
/// sorted by block height.
/// The sequence increases by one each time an event is emitted.
/// A service event emitted when the version table is updated.
/// The version is the software version which must be used for executing a height range of blocks.
/// The version pertains to Execution and Verification Nodes.
/// The table contains the current version and all the upcoming versions sorted by block height.
/// The sequence increases by one each time an event is emitted.
/// It can be used to verify no events were missed.
access(all) event VersionBeacon(
versionBoundaries: [VersionBoundary],
Expand Down Expand Up @@ -280,6 +285,18 @@ access(all) contract NodeVersionBeacon {

emit NodeVersionBoundaryFreezePeriodChanged(freezePeriod: newFreezePeriod)
}

/// Emits the given protocol state version upgrade event.
/// If the version and active view are valid, this will cause the Protocol State
/// to upgrade its model version when the event is incorporated.
/// If either the version or active view are invalid, the service event will be
/// ignored and will have no effect. All validation is performed when the service
/// event is incorporated by the Protocol State.
/// It is safe to emit the same ProtocolStateVersionUpgrade event multiple times,
/// as only version upgrade will occur.
access(all) fun emitProtocolStateVersionUpgrade(newProtocolVersion: UInt64, activeView: UInt64) {
emit ProtocolStateVersionUpgrade(newProtocolVersion: newProtocolVersion, activeView: activeView)
}
}

/// Heartbeat resource that emits the version beacon event and keeps track of upcoming versions.
Expand Down Expand Up @@ -495,6 +512,17 @@ access(all) contract NodeVersionBeacon {
return self.versionBoundaryBlockList[0]
}

/// =========================
/// Protocol State Versioning
/// =========================

/// A service event which is emitted to indicate that the Protocol State version is being upgraded.
/// This acts as a signal to begin using the upgraded Protocol State version
/// after this service event is sealed, and after view `activeView` is entered.
/// Nodes running a software version which does not support `newProtocolVersion`
/// will stop processing new blocks when they reach view `activeAtView`.
access(all) event ProtocolStateVersionUpgrade(newProtocolVersion: UInt64, activeView: UInt64)

init(versionUpdateFreezePeriod: UInt64) {
self.AdminStoragePath = /storage/NodeVersionBeaconAdmin
self.HeartbeatStoragePath = /storage/NodeVersionBeaconHeartbeat
Expand Down
14 changes: 14 additions & 0 deletions contracts/epochs/FlowClusterQC.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,20 @@ access(all) contract FlowClusterQC {
}
}

/// Represents the aggregated signature for a cluster quorum certificate.
access(all) struct ClusterQCVoteData {
/// The aggregated signature, hex-encoded. Includes one vote for each node in `voterIDs`.
access(all) let aggregatedSignature: String

/// The node IDs that contributed their vote to the aggregated signature.
access(all) let voterIDs: [String]

init(aggregatedSignature: String, voterIDs: [String]) {
self.aggregatedSignature = aggregatedSignature
self.voterIDs = voterIDs
}
}

/// The Voter resource is generated for each collection node after they register.
/// Each resource instance is good for all future potential epochs, but will
/// only be valid if the node operator has been confirmed as a collector node for the next epoch.
Expand Down
Loading
Loading