Skip to content

Commit

Permalink
Incentives: Bump to v40 consensus supporting development versions of …
Browse files Browse the repository at this point in the history
…Go SDK and Indexer. (#179)

* Bump to v40 consensus supporting development versions of Go SDK and Indexer.

* Add test cases to give confidence that inbound heartbeat transactions can be checked in the filter processor with pre-existing fields.
  • Loading branch information
gmalouf authored Dec 21, 2024
1 parent a2a9b8a commit 882de01
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 16 deletions.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,4 @@ See the [Plugin Development](./docs/PluginDevelopment.md) page for building a pl

# Contributing

Contributions are welcome! Please refer to our [CONTRIBUTING](https://github.com/algorand/go-algorand/blob/master/CONTRIBUTING.md) document for general contribution guidelines.

# Migrating from Indexer 2.x

Conduit can be used to populate data from an existing [Indexer 2.x](https://github.com/algorand/indexer/) deployment as part of upgrading to Indexer 3.x. The v3 API is 100% backwards compatible with the v2 API.

We will continue to maintain Indexer 2.x up through November 1. From that point onward, subsequent consensus upgrades will only be compatible with Indexer 3.x when paired with Conduit.

To migrate, follow the [Using Conduit to Populate an Indexer Database](./docs/tutorials/IndexerWriter.md) tutorial. When you get to the step about setting up postgres, substitute your existing database connection string. Conduit will read the database to initialize the next round.
Contributions are welcome! Please refer to our [CONTRIBUTING](https://github.com/algorand/go-algorand/blob/master/CONTRIBUTING.md) document for general contribution guidelines.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ filters:
},
},
},
// Heartbeat transaction that should not be allowed through
sdk.SignedTxnInBlock{
SignedTxnWithAD: sdk.SignedTxnWithAD{
SignedTxn: sdk.SignedTxn{
Txn: sdk.Transaction{
Header: sdk.Header{
Sender: sampleAddr1,
},
HeartbeatTxnFields: &sdk.HeartbeatTxnFields{
HbAddress: sampleAddr2,
},
},
},
},
},
// The one transaction that will be allowed through
sdk.SignedTxnInBlock{
SignedTxnWithAD: sdk.SignedTxnWithAD{
Expand Down Expand Up @@ -974,6 +989,9 @@ filters:
- tag: txn.rcv
expression-type: equal
expression: "` + sampleAddr2.String() + `"
- tag: txn.snd
expression-type: equal
expression: "` + sampleAddr3.String() + `"
`

fpBuilder, err := processors.ProcessorConstructorByName(PluginName)
Expand Down Expand Up @@ -1019,11 +1037,25 @@ filters:
},
},
},
sdk.SignedTxnInBlock{
SignedTxnWithAD: sdk.SignedTxnWithAD{
SignedTxn: sdk.SignedTxn{
Txn: sdk.Transaction{
Header: sdk.Header{
Sender: sampleAddr3,
},
HeartbeatTxnFields: &sdk.HeartbeatTxnFields{
HbAddress: sampleAddr1,
},
},
},
},
},
)

output, err := fp.Process(bd)
require.NoError(t, err)
assert.Equal(t, output.Payset, []sdk.SignedTxnInBlock{bd.Payset[0], bd.Payset[1]})
assert.Equal(t, []sdk.SignedTxnInBlock{bd.Payset[0], bd.Payset[1], bd.Payset[3]}, output.Payset)
}

func TestFilterProcessor_SearchInner(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions conduit/plugins/processors/filterprocessor/gen/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ var ignoreTags = map[string]bool{
"txn.apsu": true,
"dt.lg": true,
"dt.sa": true,
// Filter out heartbeat fields that are not obvious how to filter upon
"txn.hb": true,
}

func noCast(t reflect.StructField) bool {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.23
toolchain go1.23.3

require (
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241114170414-874d2110dae4
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241220043854-72370807aa70
github.com/algorand/go-codec/codec v1.1.10
github.com/algorand/indexer/v3 v3.6.1-0.20241115001248-bff11e95ca04
github.com/algorand/indexer/v3 v3.6.1-0.20241220213055-c5c7b4ea0f4e
github.com/google/uuid v1.6.0
github.com/jackc/pgx/v4 v4.18.2
github.com/opensearch-project/opensearch-go/v2 v2.3.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
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.20241114170414-874d2110dae4 h1:qQXdtMWlP9ynxeDEhWpUWer3AM51482pnfe7ptTDXm0=
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241114170414-874d2110dae4/go.mod h1:BkHnK2PuCqzdGPNeWUo5yo6lRjyDZ9QoMN8GIjfijrA=
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241220043854-72370807aa70 h1:nCVMHFT4U9VEC9Znsz4JVNsSFuhIpvpZidfnMtIcYJg=
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241220043854-72370807aa70/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/indexer/v3 v3.6.1-0.20241115001248-bff11e95ca04 h1:DJqpPmoyi5hmRz3HE7zse/a5xJXN2fpEjEDHXcGArdg=
github.com/algorand/indexer/v3 v3.6.1-0.20241115001248-bff11e95ca04/go.mod h1:+bZIDBTjDjOjj8odzd0dbuOyyspbIKUPXS4Pw+IOfTA=
github.com/algorand/indexer/v3 v3.6.1-0.20241220213055-c5c7b4ea0f4e h1:+c5PEl4VWD2GeTipvegStmJsE6zl073wTzWzOr+fXaM=
github.com/algorand/indexer/v3 v3.6.1-0.20241220213055-c5c7b4ea0f4e/go.mod h1:2PuGusmndLhvtsTnXbtYLiE75JI8Nfdz4YqrF8qtDqU=
github.com/algorand/oapi-codegen v1.12.0-algorand.0 h1:W9PvED+wAJc+9EeXPONnA+0zE9UhynEqoDs4OgAxKhk=
github.com/algorand/oapi-codegen v1.12.0-algorand.0/go.mod h1:tIWJ9K/qrLDVDt5A1p82UmxZIEGxv2X+uoujdhEAL48=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
Expand Down

0 comments on commit 882de01

Please sign in to comment.