Skip to content

Commit

Permalink
feat: simple performance / scalability fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
matiwinnetou committed Mar 7, 2025
1 parent 9a7f9b1 commit 9f45456
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public AccountBalanceResponse getAccountBalance(AccountBalanceRequest accountBal
CardanoAddressUtils.verifyAddress(accountAddress);

PartialBlockIdentifier blockIdentifier = accountBalanceRequest.getBlockIdentifier();
log.info("[accountBalance] Looking for block: {} || latest}", blockIdentifier);
log.debug("[accountBalance] Looking for block: {} || latest}", blockIdentifier);

if (Objects.nonNull(blockIdentifier)) {
index = blockIdentifier.getIndex();
Expand Down Expand Up @@ -92,7 +92,7 @@ private AccountBalanceResponse findBalanceDataByAddressAndBlock(String address,

return findBlockOrLast(number, hash)
.map(blockDto -> {
log.info("Looking for utxos for address {} and block {}",
log.debug("Looking for utxos for address {} and block {}",
address,
blockDto.getHash()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ public class BlockServiceImpl implements BlockService {

@Override
public Block findBlock(Long index, String hash) {
log.info("[block] Looking for block: hash={}, index={}", hash, index);
log.debug("[block] Looking for block: hash={}, index={}", hash, index);

Optional<Block> blockOpt = ledgerBlockService.findBlock(index, hash);
if (blockOpt.isPresent()) {
var block = blockOpt.get();
log.info("Block was found, hash={}", block.getHash());
log.debug("Block was found, hash={}", block.getHash());

block.setPoolDeposit(String.valueOf(protocolParamService.findProtocolParameters().getPoolDeposit()));
log.debug("full data {}", block);

return block;
}
log.error("Block was not found");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public Network getSupportedNetwork() {

private NetworkStatus networkStatus() {
log.info("[networkStatus] Looking for latest block");

BlockIdentifierExtended latestBlock = ledgerBlockService.findLatestBlockIdentifier();
log.debug("[networkStatus] Latest block found {}", latestBlock);

Expand Down

0 comments on commit 9f45456

Please sign in to comment.