diff --git a/core/eth/reader.go b/core/eth/reader.go index 8629e9c7bf..ffd244c4e1 100644 --- a/core/eth/reader.go +++ b/core/eth/reader.go @@ -3,7 +3,6 @@ package eth import ( "context" "crypto/ecdsa" - "fmt" "math/big" "strings" @@ -141,7 +140,7 @@ func (t *Reader) updateContractBindings(blsOperatorStateRetrieverAddr, eigenDASe return err } - t.logger.Debug("Addresses!!!!!!!!!!!!!!", "blsOperatorStateRetrieverAddr", blsOperatorStateRetrieverAddr.Hex(), "eigenDAServiceManagerAddr", eigenDAServiceManagerAddr.Hex(), "registryCoordinatorAddr", registryCoordinatorAddr.Hex(), "blsPubkeyRegistryAddr", blsPubkeyRegistryAddr.Hex()) + t.logger.Debug("Addresses", "blsOperatorStateRetrieverAddr", blsOperatorStateRetrieverAddr.Hex(), "eigenDAServiceManagerAddr", eigenDAServiceManagerAddr.Hex(), "registryCoordinatorAddr", registryCoordinatorAddr.Hex(), "blsPubkeyRegistryAddr", blsPubkeyRegistryAddr.Hex()) contractBLSPubkeyReg, err := blsapkreg.NewContractBLSApkRegistry(blsPubkeyRegistryAddr, t.ethClient) if err != nil { @@ -218,7 +217,7 @@ func (t *Reader) updateContractBindings(blsOperatorStateRetrieverAddr, eigenDASe if err != nil { t.logger.Error("Failed to fetch PaymentVault address", "err", err) //TODO(hopeyen): return err when the contract is deployed - return err + // return err } else { contractPaymentVault, err = paymentvault.NewContractPaymentVault(paymentVaultAddr, t.ethClient) if err != nil { @@ -227,8 +226,6 @@ func (t *Reader) updateContractBindings(blsOperatorStateRetrieverAddr, eigenDASe } } - t.logger.Debug("Made payment vault binding", "contract addr", paymentVaultAddr, "contract struct", contractPaymentVault) - t.bindings = &ContractBindings{ ServiceManagerAddr: eigenDAServiceManagerAddr, RegCoordinatorAddr: registryCoordinatorAddr, @@ -599,10 +596,7 @@ func (t *Reader) CalculateOperatorChurnApprovalDigestHash( } func (t *Reader) GetCurrentBlockNumber(ctx context.Context) (uint32, error) { - fmt.Println("Getting current block number") - fmt.Println("ethClient", t.ethClient) bn, err := t.ethClient.BlockNumber(ctx) - fmt.Println("Got current block number", bn) return uint32(bn), err } @@ -739,12 +733,9 @@ func (t *Reader) GetReservedPayments(ctx context.Context, accountIDs []gethcommo } func (t *Reader) GetReservedPaymentByAccount(ctx context.Context, accountID gethcommon.Address) (*core.ReservedPayment, error) { - fmt.Println("Get reserved payment as reader", accountID) if t.bindings.PaymentVault == nil { - fmt.Println("payment vault not deployed") return nil, errors.New("payment vault not deployed") } - fmt.Println("payment vault query") reservation, err := t.bindings.PaymentVault.GetReservation(&bind.CallOpts{ Context: ctx, }, accountID) @@ -780,7 +771,6 @@ func (t *Reader) GetOnDemandPayments(ctx context.Context, accountIDs []gethcommo } func (t *Reader) GetOnDemandPaymentByAccount(ctx context.Context, accountID gethcommon.Address) (*core.OnDemandPayment, error) { - fmt.Println("Reader getOnDemandPaymentByAccount", accountID) if t.bindings.PaymentVault == nil { return nil, errors.New("payment vault not deployed") } diff --git a/core/eth/utils.go b/core/eth/utils.go index 79eef4995b..7334f62f98 100644 --- a/core/eth/utils.go +++ b/core/eth/utils.go @@ -140,15 +140,7 @@ func isZeroValuedReservation(reservation paymentvault.IPaymentVaultReservation) // ConvertToReservedPayment converts a upstream binding data structure to local definition. // Returns an error if the input reservation is zero-valued. func ConvertToReservedPayment(reservation paymentvault.IPaymentVaultReservation) (*core.ReservedPayment, error) { - fmt.Println("Convert to reserved payment", - "SymbolsPerSecond", reservation.SymbolsPerSecond, - "StartTimestamp", reservation.StartTimestamp, - "EndTimestamp", reservation.EndTimestamp, - "QuorumNumbers", reservation.QuorumNumbers, - "QuorumSplits", reservation.QuorumSplits, - ) if isZeroValuedReservation(reservation) { - fmt.Println("zer valued") return nil, fmt.Errorf("reservation is not a valid active reservation") } diff --git a/core/indexer/indexer_suite_test.go b/core/indexer/indexer_suite_test.go index d24fb462f0..03dd4e5cbf 100644 --- a/core/indexer/indexer_suite_test.go +++ b/core/indexer/indexer_suite_test.go @@ -45,7 +45,6 @@ var _ = BeforeSuite(func() { testConfig.Deployers[0].DeploySubgraphs = false if testConfig.Environment.IsLocal() { - fmt.Println("Starting anvil core indexer indexer_suite_test") testConfig.StartAnvil() fmt.Println("Deploying experiment") diff --git a/core/meterer/onchain_state.go b/core/meterer/onchain_state.go index 79d40afb8c..367e0c7813 100644 --- a/core/meterer/onchain_state.go +++ b/core/meterer/onchain_state.go @@ -142,7 +142,6 @@ func (pcs *OnchainPaymentState) RefreshOnchainPaymentState(ctx context.Context) // GetReservedPaymentByAccount returns a pointer to the active reservation for the given account ID; no writes will be made to the reservation func (pcs *OnchainPaymentState) GetReservedPaymentByAccount(ctx context.Context, accountID gethcommon.Address) (*core.ReservedPayment, error) { - fmt.Println("Getting reserved payment by account as onchainpaymentstate", accountID) pcs.ReservationsLock.Lock() defer pcs.ReservationsLock.Unlock() if reservation, ok := (pcs.ReservedPayments)[accountID]; ok { @@ -151,45 +150,34 @@ func (pcs *OnchainPaymentState) GetReservedPaymentByAccount(ctx context.Context, } // pulls the chain state - fmt.Println("get reserved payment from onchain", accountID) res, err := pcs.tx.GetReservedPaymentByAccount(ctx, accountID) if err != nil { return nil, err } - fmt.Println("Got reservation") - // pcs.ReservationsLock.Lock() (pcs.ReservedPayments)[accountID] = res - // pcs.ReservationsLock.Unlock() return res, nil } // GetOnDemandPaymentByAccount returns a pointer to the on-demand payment for the given account ID; no writes will be made to the payment func (pcs *OnchainPaymentState) GetOnDemandPaymentByAccount(ctx context.Context, accountID gethcommon.Address) (*core.OnDemandPayment, error) { - fmt.Println("pcs getOnDemandPaymentByAccount", accountID) - pcs.OnDemandLocks.RLock() - defer pcs.OnDemandLocks.RUnlock() + pcs.OnDemandLocks.Lock() + defer pcs.OnDemandLocks.Unlock() if payment, ok := (pcs.OnDemandPayments)[accountID]; ok { return payment, nil } // pulls the chain state - fmt.Println("pcs getOnDemandPaymentByAccount pulls the chain state", accountID) res, err := pcs.tx.GetOnDemandPaymentByAccount(ctx, accountID) if err != nil { return nil, err } - fmt.Println("pcs getOnDemandPaymentByAccount got from chain state", res) - pcs.OnDemandLocks.Lock() + (pcs.OnDemandPayments)[accountID] = res - pcs.OnDemandLocks.Unlock() return res, nil } func (pcs *OnchainPaymentState) GetOnDemandQuorumNumbers(ctx context.Context) ([]uint8, error) { - fmt.Println("Getting on demand quorum numbers") - fmt.Println("Getting on demand quorum numbers tx ", pcs.tx) blockNumber, err := pcs.tx.GetCurrentBlockNumber(ctx) - if err != nil { return nil, err } diff --git a/core/thegraph/state_integration_test.go b/core/thegraph/state_integration_test.go index 76a14071dd..f7326d22be 100644 --- a/core/thegraph/state_integration_test.go +++ b/core/thegraph/state_integration_test.go @@ -50,7 +50,7 @@ func setup() { testConfig = deploy.NewTestConfig(testName, rootPath) testConfig.Deployers[0].DeploySubgraphs = true - fmt.Println("Starting anvil ---------- core thegraph state_integration_test") + fmt.Println("Starting anvil") testConfig.StartAnvil() fmt.Println("Starting graph node") diff --git a/disperser/apiserver/server_v2.go b/disperser/apiserver/server_v2.go index 61921aed05..070f678427 100644 --- a/disperser/apiserver/server_v2.go +++ b/disperser/apiserver/server_v2.go @@ -239,7 +239,6 @@ func (s *DispersalServerV2) GetPaymentState(ctx context.Context, req *pb.GetPaym }() accountID := gethcommon.HexToAddress(req.AccountId) - s.logger.Debug("Serve getpaymentstate request", accountID) // validate the signature if err := s.authenticator.AuthenticatePaymentStateRequest(req.GetSignature(), req.GetAccountId()); err != nil { @@ -251,19 +250,16 @@ func (s *DispersalServerV2) GetPaymentState(ctx context.Context, req *pb.GetPaym minNumSymbols := s.meterer.ChainPaymentState.GetMinNumSymbols() pricePerSymbol := s.meterer.ChainPaymentState.GetPricePerSymbol() reservationWindow := s.meterer.ChainPaymentState.GetReservationWindow() - s.logger.Debug("got on chain global params") // off-chain account specific payment state now := uint64(time.Now().Unix()) currentReservationPeriod := meterer.GetReservationPeriod(now, reservationWindow) - s.logger.Debug("now get bin records") binRecords, err := s.meterer.OffchainStore.GetBinRecords(ctx, req.AccountId, currentReservationPeriod) if err != nil { s.logger.Debug("failed to get active reservation", err, accountID) // return nil, api.NewErrorNotFound("failed to get active reservation") binRecords = [3]*pb.BinRecord{} } - s.logger.Debug("got bin records, now get largest cumulative payment") largestCumulativePayment, err := s.meterer.OffchainStore.GetLargestCumulativePayment(ctx, req.AccountId) if err != nil { s.logger.Debug("err get largest cumulative payment", err) @@ -271,9 +267,7 @@ func (s *DispersalServerV2) GetPaymentState(ctx context.Context, req *pb.GetPaym largestCumulativePayment = big.NewInt(0) } // on-Chain account state - fmt.Println("Getpaymentstate now getting reserved payment", accountID) reservation, err := s.meterer.ChainPaymentState.GetReservedPaymentByAccount(ctx, accountID) - fmt.Println("Getpaymentstate getting reserved payment result", accountID) if err != nil { s.logger.Debug("cannot get reservation", err) // return nil, api.NewErrorNotFound("failed to get active reservation") @@ -285,18 +279,13 @@ func (s *DispersalServerV2) GetPaymentState(ctx context.Context, req *pb.GetPaym QuorumSplits: []uint8{}, } } - fmt.Println("Getpaymentstate now getting ondemand payment", accountID) onDemandPayment, err := s.meterer.ChainPaymentState.GetOnDemandPaymentByAccount(ctx, accountID) if err != nil { s.logger.Debug("cannot get ondemand payment", err) // return nil, api.NewErrorNotFound("failed to get on-demand payment") onDemandPayment = &core.OnDemandPayment{CumulativePayment: big.NewInt(0)} } - s.logger.Debug("Got onchain ondemand payment", onDemandPayment) - s.logger.Debug("Got onchain ondemand payment", onDemandPayment.CumulativePayment) - s.logger.Debug("Got onchain ondemand payment", onDemandPayment.CumulativePayment.Bytes()) - s.logger.Debug("got payment global params; now build reply") paymentGlobalParams := pb.PaymentGlobalParams{ GlobalSymbolsPerSecond: globalSymbolsPerSecond, MinNumSymbols: minNumSymbols, diff --git a/disperser/cmd/apiserver/main.go b/disperser/cmd/apiserver/main.go index b43377f78c..6101313b13 100644 --- a/disperser/cmd/apiserver/main.go +++ b/disperser/cmd/apiserver/main.go @@ -103,7 +103,6 @@ func RunDisperserServer(ctx *cli.Context) error { UpdateInterval: time.Duration(config.UpdateInterval) * time.Second, } - logger.Info("Creating onchain payment state apiserver main.go") paymentChainState, err := mt.NewOnchainPaymentState(context.Background(), transactor) if err != nil { return fmt.Errorf("failed to create onchain payment state: %w", err) @@ -139,7 +138,7 @@ func RunDisperserServer(ctx *cli.Context) error { logger, ) if err != nil { - return fmt.Errorf("failed to create offchain store (cmd apiserver main): %w", err) + return fmt.Errorf("failed to create offchain store: %w", err) } // add some default sensible configs meterer = mt.NewMeterer( diff --git a/inabox/bin.sh b/inabox/bin.sh index 1a92ec66d8..e77bc581e8 100755 --- a/inabox/bin.sh +++ b/inabox/bin.sh @@ -236,7 +236,7 @@ function stop_detached { function start_anvil { - echo "Starting anvil server .... inabox bin.sh." + echo "Starting anvil server ....." anvil --host 0.0.0.0 > /dev/null & anvil_pid=$! echo "Anvil server started ....." diff --git a/inabox/tests/integration_suite_test.go b/inabox/tests/integration_suite_test.go index 7b0e0f59da..4d4d7be4de 100644 --- a/inabox/tests/integration_suite_test.go +++ b/inabox/tests/integration_suite_test.go @@ -85,28 +85,27 @@ var _ = BeforeSuite(func() { } } - fmt.Println("Starting localstack!!!!!!!!!!!!!!!!!!!!!!!!!!!") - - localStackPort = "4570" - pool, resource, err := deploy.StartDockertestWithLocalstackContainer(localStackPort) - Expect(err).To(BeNil()) - dockertestPool = pool - dockertestResource = resource testConfig = deploy.NewTestConfig(testName, rootPath) if testConfig.Environment.IsLocal() { if !inMemoryBlobStore { fmt.Println("Using shared Blob Store") + localStackPort = "4570" + pool, resource, err := deploy.StartDockertestWithLocalstackContainer(localStackPort) + Expect(err).To(BeNil()) + dockertestPool = pool + dockertestResource = resource err = deploy.DeployResources(pool, localStackPort, metadataTableName, bucketTableName, metadataTableNameV2) Expect(err).To(BeNil()) } else { fmt.Println("Using in-memory Blob Store") } + // fmt.Println("Making payment related tables....") // err = deploy.DeployPaymentRelatedTables(pool, localStackPort) // Expect(err).To(BeNil()) - fmt.Println("Starting anvil inabox/tests/integration_suite_test.go") + fmt.Println("Starting anvil") testConfig.StartAnvil() if deployer, ok := testConfig.GetDeployer(testConfig.EigenDA.Deployer); ok && deployer.DeploySubgraphs { diff --git a/node/plugin/tests/plugin_test.go b/node/plugin/tests/plugin_test.go index db01c1e1f9..b01daf2df5 100644 --- a/node/plugin/tests/plugin_test.go +++ b/node/plugin/tests/plugin_test.go @@ -58,7 +58,7 @@ func setup(m *testing.M) { return } - fmt.Println("Starting anvil node plugin tests plugin_test.go") + fmt.Println("Starting anvil") testConfig.StartAnvil() fmt.Println("Deploying experiment") diff --git a/operators/churner/tests/churner_test.go b/operators/churner/tests/churner_test.go index ec01983f72..ba9f11c522 100644 --- a/operators/churner/tests/churner_test.go +++ b/operators/churner/tests/churner_test.go @@ -75,7 +75,7 @@ func setup(m *testing.M) { return } - fmt.Println("Starting anvil operators churner tests churner_test.go") + fmt.Println("Starting anvil") testConfig.StartAnvil() fmt.Println("Deploying experiment")