Skip to content

Commit

Permalink
oracle new
Browse files Browse the repository at this point in the history
  • Loading branch information
lbtsm committed Aug 29, 2024
1 parent a20de7e commit 3eba4d9
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 17 deletions.
1 change: 0 additions & 1 deletion chains/matic/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func assembleProof(m *chain.Messenger, log *types.Log, proofType int64, toChainI
proof.CacheReceipt[key] = receipts
}

fmt.Println("method -------------------------------- ", method)
var orderId32 [32]byte
for idx, v := range orderId {
orderId32[idx] = v
Expand Down
Binary file removed eth2/eth2-proof
Binary file not shown.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ require (
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/buraksezer/consistent v0.9.0 // indirect
github.com/centrifuge/go-substrate-rpc-client v2.0.0+incompatible // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
Expand Down Expand Up @@ -62,7 +61,6 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pbnjay/memory v0.0.0-20190104145345-974d429e7ae4 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pierrec/xxHash v0.1.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
Expand Down
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
github.com/centrifuge/go-substrate-rpc-client v2.0.0+incompatible h1:FvPewruOgelqA/DVBdX7/Q6znUGGQ+g0ciG5tA2Fk98=
github.com/centrifuge/go-substrate-rpc-client v2.0.0+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/cp v1.0.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU=
Expand Down Expand Up @@ -706,8 +704,6 @@ github.com/labstack/echo/v4 v4.2.0/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4F
github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/lbtsm/gotron-sdk v0.0.0-20231025070359-ac656af37c4a h1:f1N82XwpXb57JFhW03/kR/jK4YJTE90/QrHiz/0riXg=
github.com/lbtsm/gotron-sdk v0.0.0-20231025070359-ac656af37c4a/go.mod h1:rwhdwJSs5ffxJP/rWDjwOmOm95jHuGctideF2iKVly8=
github.com/lbtsm/gotron-sdk v0.0.0-20240606062614-534038e71cd3 h1:qQl12EKzZEBlO673q0JcwYmKcchsNU3AmUk+tpil07A=
github.com/lbtsm/gotron-sdk v0.0.0-20240606062614-534038e71cd3/go.mod h1:rwhdwJSs5ffxJP/rWDjwOmOm95jHuGctideF2iKVly8=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
Expand Down Expand Up @@ -888,7 +884,6 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi
github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pierrec/xxHash v0.1.5 h1:n/jBpwTHiER4xYvK3/CdPVnLDPchj8eTJFFLUb4QHBo=
github.com/pierrec/xxHash v0.1.5/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
3 changes: 0 additions & 3 deletions internal/chain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ func ParseConfig(chainCfg *core.ChainConfig) (*Config, error) {
for _, addr := range strings.Split(contract, ",") {
config.McsContract = append(config.McsContract, common.HexToAddress(addr))
}
} else {
return nil, fmt.Errorf("must provide opts.mcs field for ethereum config")
}

if gasPrice, ok := chainCfg.Opts[MaxGasPriceOpt]; ok {
price := big.NewInt(0)
_, pass := price.SetString(gasPrice, 10)
Expand Down
10 changes: 5 additions & 5 deletions internal/chain/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ func (m *Oracle) filterOracle(latestBlock uint64) error {
m.Cfg.StartBlock = big.NewInt(ele.Id)
continue
}
if latestBlock-ele.BlockNumber < m.BlockConfirmations.Uint64() {
m.Log.Debug("Block not ready, will retry", "currentBlock", ele.BlockNumber, "latest", latestBlock)
time.Sleep(constant.BalanceRetryInterval)
continue
}
//if latestBlock-ele.BlockNumber < m.BlockConfirmations.Uint64() {
// m.Log.Debug("Block not ready, will retry", "currentBlock", ele.BlockNumber, "latest", latestBlock)
// time.Sleep(constant.BalanceRetryInterval)
// continue
//}

split := strings.Split(ele.Topic, ",")
topics := make([]common.Hash, 0, len(split))
Expand Down
1 change: 0 additions & 1 deletion internal/chain/messenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ func log2Msg(m *Messenger, log *types.Log, idx int) (int, error) {
m.Log.Info("CurrentBlock not verify", "txHash", log.TxHash, "toChainID", toChainID)
return 0, err
}
m.Log.Info("Event Proof", "txHash", log.TxHash, "proofType", proofType, "toChainID", toChainID)
if err != nil {
return 0, err
}
Expand Down
1 change: 1 addition & 0 deletions internal/chain/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func (w *Writer) sendTx(toAddress *common.Address, value *big.Int, input []byte)
//gasLimit = 5000000000
gasTipCap := w.conn.Opts().GasTipCap
gasFeeCap := w.conn.Opts().GasFeeCap
w.log.Info("SendTx gasPrice before", "gasPrice", gasPrice, "gasTipCap", gasTipCap, "gasFeeCap", gasFeeCap)
if w.cfg.LimitMultiplier > 1 {
gasLimit = uint64(float64(gasLimit) * w.cfg.LimitMultiplier)
}
Expand Down

0 comments on commit 3eba4d9

Please sign in to comment.