Skip to content

Commit 12f0668

Browse files
committed
rename: Fingerprint->StaticID
1 parent f0b14fc commit 12f0668

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

engine/collection/ingest/engine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ func (e *Engine) onTransaction(originID flow.Identifier, tx *flow.TransactionBod
261261
return fmt.Errorf("could not get cluster responsible for tx: %x", txID)
262262
}
263263

264-
localClusterFingerPrint := localCluster.Fingerprint()
265-
txClusterFingerPrint := txCluster.Fingerprint()
264+
localClusterFingerPrint := localCluster.StaticID()
265+
txClusterFingerPrint := txCluster.StaticID()
266266
log = log.With().
267267
Hex("local_cluster", logging.ID(localClusterFingerPrint)).
268268
Hex("tx_cluster", logging.ID(txClusterFingerPrint)).

integration/tests/collection/ingress_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (suite *IngressSuite) TestTxIngressMultiCluster_CorrectCluster() {
203203
// ensure the transaction IS NOT included in other cluster collections
204204
for _, cluster := range clusters {
205205
// skip the target cluster
206-
if cluster.Fingerprint() == targetCluster.Fingerprint() {
206+
if cluster.StaticID() == targetCluster.StaticID() {
207207
continue
208208
}
209209

@@ -292,7 +292,7 @@ func (suite *IngressSuite) TestTxIngressMultiCluster_OtherCluster() {
292292
// ensure the transaction IS NOT included in other cluster collections
293293
for _, cluster := range clusters {
294294
// skip the target cluster
295-
if cluster.Fingerprint() == targetCluster.Fingerprint() {
295+
if cluster.StaticID() == targetCluster.StaticID() {
296296
continue
297297
}
298298

integration/tests/collection/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (suite *CollectorSuite) TxForCluster(target flow.IdentityList) *sdk.Transac
188188
require.Nil(suite.T(), err)
189189
routed, ok := clusters.ByTxID(convert.IDFromSDK(tx.ID()))
190190
require.True(suite.T(), ok)
191-
if routed.Fingerprint() == target.Fingerprint() {
191+
if routed.StaticID() == target.StaticID() {
192192
break
193193
}
194194
}

model/flow/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ func (cl ClusterList) ByNodeID(nodeID Identifier) (IdentityList, uint, bool) {
116116

117117
// IndexOf returns the index of the given cluster.
118118
func (cl ClusterList) IndexOf(cluster IdentityList) (uint, bool) {
119-
clusterFingerprint := cluster.Fingerprint()
119+
clusterFingerprint := cluster.StaticID()
120120
for index, other := range cl {
121-
if other.Fingerprint() == clusterFingerprint {
121+
if other.StaticID() == clusterFingerprint {
122122
return uint(index), true
123123
}
124124
}

model/flow/identity.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,10 @@ func (il IdentityList) PublicStakingKeys() []crypto.PublicKey {
397397
return pks
398398
}
399399

400-
func (il IdentityList) Fingerprint() Identifier {
400+
// StaticID uniquely identifies a list of identities, by node ID. This can be used
401+
// to perpetually identify a group of nodes, even if mutable fields of some nodes
402+
// are changed, as node IDs are immutable.
403+
func (il IdentityList) StaticID() Identifier {
401404
return GetIDs(il).Fingerprint()
402405
}
403406

state/protocol/badger/snapshot_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func TestClusters(t *testing.T) {
204204
actual := actualClusters[i]
205205

206206
assert.Equal(t, len(expected), len(actual))
207-
assert.Equal(t, expected.Fingerprint(), actual.Fingerprint())
207+
assert.Equal(t, expected.StaticID(), actual.StaticID())
208208
}
209209
})
210210
}

utils/unittest/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func AlterTransactionForCluster(tx flow.TransactionBody, clusters flow.ClusterLi
3636
panic(fmt.Sprintf("unable to find cluster by txID: %x", tx.ID()))
3737
}
3838

39-
if routed.Fingerprint() == target.Fingerprint() {
39+
if routed.StaticID() == target.StaticID() {
4040
return tx
4141
}
4242
}

0 commit comments

Comments
 (0)