Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Release Notes

## [v1.13.1](https://github.com/ava-labs/avalanchego/releases/tag/v1.13.1)

This version is backwards compatible to [v1.13.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.13.0). It is optional, but encouraged. The supported plugin version is `39`.

### AVM

- Removed indexer config flags
- `--index-transactions`
- `--index-allow-incomplete`

### APIs

- Removed `avm.getAddressTxs` api

## [v1.13.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.13.0)

This upgrade consists of the following Avalanche Community Proposal (ACP):
Expand Down
2 changes: 1 addition & 1 deletion vms/avm/block/builder/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ func TestBlockBuilderAddLocalTx(t *testing.T) {
require.NoError(err)

clk := &mockable.Clock{}
onAccept := func(*txs.Tx) error { return nil }
onAccept := func(*txs.Tx) {}
now := time.Now()
parentTimestamp := now.Add(-2 * time.Second)
parentID := ids.GenerateTestID()
Expand Down
8 changes: 1 addition & 7 deletions vms/avm/block/executor/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,7 @@ func (b *Block) Accept(context.Context) error {

txs := b.Txs()
for _, tx := range txs {
if err := b.manager.onAccept(tx); err != nil {
return fmt.Errorf(
"failed to mark tx %q as accepted: %w",
blkID,
err,
)
}
b.manager.onAccept(tx)
}

b.manager.lastAccepted = blkID
Expand Down
5 changes: 2 additions & 3 deletions vms/avm/block/executor/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewManager(
state state.State,
backend *executor.Backend,
clk *mockable.Clock,
onAccept func(*txs.Tx) error,
onAccept func(*txs.Tx),
) Manager {
lastAccepted := state.GetLastAccepted()
return &manager{
Expand All @@ -78,8 +78,7 @@ type manager struct {
clk *mockable.Clock
// Invariant: onAccept is called when [tx] is being marked as accepted, but
// before its state changes are applied.
// Invariant: any error returned by onAccept should be considered fatal.
onAccept func(*txs.Tx) error
onAccept func(*txs.Tx)

// blkIDToState is a map from a block's ID to the state of the block.
// Blocks are put into this map when they are verified.
Expand Down
12 changes: 4 additions & 8 deletions vms/avm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ import (
)

var DefaultConfig = Config{
Network: network.DefaultConfig,
IndexTransactions: false,
IndexAllowIncomplete: false,
ChecksumsEnabled: false,
Network: network.DefaultConfig,
ChecksumsEnabled: false,
}

type Config struct {
Network network.Config `json:"network"`
IndexTransactions bool `json:"index-transactions"`
IndexAllowIncomplete bool `json:"index-allow-incomplete"`
ChecksumsEnabled bool `json:"checksums-enabled"`
Network network.Config `json:"network"`
ChecksumsEnabled bool `json:"checksums-enabled"`
}

func ParseConfig(configBytes []byte) (Config, error) {
Expand Down
27 changes: 0 additions & 27 deletions vms/avm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ values for this config are:

```json
{
"index-transactions": false,
"index-allow-incomplete": false,
"checksums-enabled": false
}
```
Expand All @@ -29,31 +27,6 @@ Default values are overridden only if explicitly specified in the config.

The parameters are as follows:

## Transaction Indexing

### `index-transactions`

_Boolean_

Enables AVM transaction indexing if set to `true`.
When set to `true`, AVM transactions are indexed against the `address` and
`assetID` involved. This data is available via `avm.getAddressTxs`
[API](/reference/avalanchego/x-chain/api.md#avmgetaddresstxs).

:::note
If `index-transactions` is set to true, it must always be set to true
for the node's lifetime. If set to `false` after having been set to `true`, the
node will refuse to start unless `index-allow-incomplete` is also set to `true`
(see below).
:::

### `index-allow-incomplete`

_Boolean_

Allows incomplete indices. This config value is ignored if there is no X-Chain indexed data in the DB and
`index-transactions` is set to `false`.

### `checksums-enabled`

_Boolean_
Expand Down
10 changes: 3 additions & 7 deletions vms/avm/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ func TestParseConfig(t *testing.T) {
name: "manually specified checksums enabled",
configBytes: []byte(`{"checksums-enabled":true}`),
expectedConfig: Config{
Network: network.DefaultConfig,
IndexTransactions: DefaultConfig.IndexTransactions,
IndexAllowIncomplete: DefaultConfig.IndexAllowIncomplete,
ChecksumsEnabled: true,
Network: network.DefaultConfig,
ChecksumsEnabled: true,
},
},
{
Expand All @@ -56,9 +54,7 @@ func TestParseConfig(t *testing.T) {
ExpectedBloomFilterFalsePositiveProbability: network.DefaultConfig.ExpectedBloomFilterFalsePositiveProbability,
MaxBloomFilterFalsePositiveProbability: network.DefaultConfig.MaxBloomFilterFalsePositiveProbability,
},
IndexTransactions: DefaultConfig.IndexTransactions,
IndexAllowIncomplete: DefaultConfig.IndexAllowIncomplete,
ChecksumsEnabled: DefaultConfig.ChecksumsEnabled,
ChecksumsEnabled: DefaultConfig.ChecksumsEnabled,
},
},
}
Expand Down
1 change: 0 additions & 1 deletion vms/avm/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func setup(tb testing.TB, c *envConfig) *environment {
}

vmDynamicConfig := DefaultConfig
vmDynamicConfig.IndexTransactions = true
if c.vmDynamicConfig != nil {
vmDynamicConfig = *c.vmDynamicConfig
}
Expand Down
Loading