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

remove the legacy plugins, shorten the health checker interval. #49

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 0 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CONF_FILE = ./config/oracle_config.yml
E2E_TEST_DIR = ./e2e_test
E2E_TEST_PLUGIN_DIR = $(E2E_TEST_DIR)/plugins
E2E_TEST_TEMPLATE_PLUGIN_DIR = $(E2E_TEST_PLUGIN_DIR)/template_plugins
E2E_TEST_PRD_PLUGIN_DIR = $(E2E_TEST_PLUGIN_DIR)/production_plugins
E2E_TEST_SML_PLUGIN_DIR = $(E2E_TEST_PLUGIN_DIR)/simulator_plugins
E2E_TEST_OUTLIER_PLUGIN_DIR = $(E2E_TEST_PLUGIN_DIR)/outlier_plugins
E2E_TEST_MIX_PLUGIN_DIR = $(E2E_TEST_PLUGIN_DIR)/mix_plugins
Expand Down Expand Up @@ -44,7 +43,6 @@ mkdir:
mkdir -p $(SIMULATOR_BIN_DIR)
mkdir -p $(E2E_TEST_PLUGIN_DIR)
mkdir -p $(E2E_TEST_TEMPLATE_PLUGIN_DIR)
mkdir -p $(E2E_TEST_PRD_PLUGIN_DIR)
mkdir -p $(E2E_TEST_SML_PLUGIN_DIR)
mkdir -p $(E2E_TEST_MIX_PLUGIN_DIR)
mkdir -p $(E2E_TEST_FOREX_PLUGIN_DIR)
Expand Down Expand Up @@ -74,10 +72,6 @@ e2e-test-stuffs:
go build -o $(E2E_TEST_DIR)/simulator $(SIMULATOR_SRC_DIR)/main.go
chmod +x $(E2E_TEST_DIR)/simulator

# build binance plugin for e2e test.
go build -o $(E2E_TEST_PRD_PLUGIN_DIR)/binance $(PLUGIN_SRC_DIR)/binance/binance.go
chmod +x $(E2E_TEST_PRD_PLUGIN_DIR)/binance

# build amm plugin for e2e test.
go build -o $(E2E_TEST_CRYPTO_PLUGIN_DIR)/crypto_uniswap $(PLUGIN_SRC_DIR)/crypto_uniswap/uniswap_usdcx/crypto_uniswap_usdcx.go
chmod +x $(E2E_TEST_CRYPTO_PLUGIN_DIR)/*
Expand Down Expand Up @@ -120,13 +114,6 @@ amm-plugins:
go build -o $(PLUGIN_DIR)/crypto_uniswap $(PLUGIN_SRC_DIR)/crypto_uniswap/uniswap_usdcx/crypto_uniswap_usdcx.go
chmod +x $(PLUGIN_DIR)/*

# legacy piccadilly cax plugin, it sources order books from a CEX service built in python.
piccadilly-cax-plugin:
go build -o $(PLUGIN_DIR)/pcgc_cax $(PLUGIN_SRC_DIR)/pcgc_cax/
chmod +x $(PLUGIN_DIR)/pcgc_cax
# cp autonity round4 game PCGC CAX plugins for e2e testing
cp $(PLUGIN_DIR)/pcgc_cax $(E2E_TEST_CRYPTO_PLUGIN_DIR)/pcgc_cax

# build ATN-USDC, NTN-USDC, NTN-ATN data point simulator binary
crypto_source_simulator:
go build -o $(SIMULATOR_BIN_DIR)/simulator $(SIMULATOR_SRC_DIR)/main.go
Expand Down
54 changes: 0 additions & 54 deletions e2e_test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,30 +201,6 @@ func TestAddCommitteeMember(t *testing.T) {
testNewValidatorJoinToCommittee(t, network, client, o, aut, endRound, pricePrecision)
}

func TestHappyCaseWithBinanceDataService(t *testing.T) {
var netConf = &NetworkConfig{
EnableL1Logs: false,
Symbols: []string{"BTC-USD", "BTC-USDC", "BTC-USDT", "BTC-USD4"},
VotePeriod: defaultVotePeriod,
PluginDIRs: []string{binancePlugDir, binancePlugDir, binancePlugDir, binancePlugDir},
}
network, err := createNetwork(netConf, numberOfValidators)
require.NoError(t, err)
defer network.Stop()

client, err := ethclient.Dial(fmt.Sprintf("ws://%s:%d", network.L1Nodes[0].Host, network.L1Nodes[0].WSPort))
require.NoError(t, err)
defer client.Close()

// bind client with oracle contract address
o, err := contract.NewOracle(types.OracleContractAddress, client)
require.NoError(t, err)

// first test happy case.
endRound := uint64(10)
testBinanceDataHappyCase(t, o, endRound)
}

func TestFeeRefund(t *testing.T) {
var netConf = &NetworkConfig{
EnableL1Logs: false,
Expand Down Expand Up @@ -821,36 +797,6 @@ func testRestartL1Node(t *testing.T, net *Network, index int, o *contract.Oracle
}
}

func testBinanceDataHappyCase(t *testing.T, o *contract.Oracle, beforeRound uint64) {
for {
time.Sleep(1 * time.Minute)
round, err := o.GetRound(nil)
require.NoError(t, err)

// continue to wait until end round.
if round.Uint64() < beforeRound {
continue
}

symbols, err := o.GetSymbols(nil)
require.NoError(t, err)

// as current round is not finalized yet, thus the round data of it haven't being aggregate,
// thus we will query the last round's data for the verification.
lastRound := new(big.Int).SetUint64(round.Uint64() - 1)

// get last round data for each symbol.
for _, s := range symbols {
d, err := o.GetRoundData(nil, lastRound, s)
require.NoError(t, err)
require.NotEqual(t, uint64(0), d.Price.Uint64())
require.Equal(t, true, d.Success)
}

break
}
}

func testAddNewSymbols(t *testing.T, network *Network, client *ethclient.Client, o *contract.Oracle, beforeRound uint64,
pricePrecision decimal.Decimal) {
chainID, err := client.ChainID(context.Background())
Expand Down
1 change: 0 additions & 1 deletion e2e_test/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var (
outlierPlugDir = "./plugins/outlier_plugins"
forexPlugDir = "./plugins/forex_plugins"
cryptoPlugDir = "./plugins/crypto_plugins"
binancePlugDir = "./plugins/production_plugins"
simulatorPlugDir = "./plugins/simulator_plugins"
mixPluginDir = "./plugins/mix_plugins"
defaultGenesis = "./autonity_l1_config/genesis_template.json"
Expand Down
2 changes: 1 addition & 1 deletion plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func (tc *TemplateClient) FetchPrice(symbols []string) (common.Prices, error) {
return nil, err
}

tc.logger.Info("binance", "data", prices)
tc.logger.Info("template_plugin", "data", prices)
*/

// in this template, we just return fix values.
Expand Down
127 changes: 0 additions & 127 deletions plugins/binance/binance.go

This file was deleted.

23 changes: 0 additions & 23 deletions plugins/binance/binance_test.go

This file was deleted.

Loading
Loading