Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b6be46c
Get RPC provider url from config
whichnode Jan 8, 2025
cc51184
Merge pull request #4 from whichnode/configure-rpc-provider
whichnode Jan 8, 2025
ce0985d
Fix up static URLs to point to new deployment
whichnode Jan 8, 2025
93e7d57
Merge pull request #5 from whichnode/fixup-static-urls
whichnode Jan 8, 2025
cf02e96
Update default RPC node list
whichnode May 9, 2025
57aab23
Merge pull request #6 from whichnode/update-rpc-node-list
whichnode May 9, 2025
9ff881e
Fix for build errors when using currently specified styled-components…
whichnode May 10, 2025
6b0c069
Merge pull request #7 from whichnode/fix-build-for-new-styled-components
whichnode May 10, 2025
bcc14d7
Update to current/latest Rust version
whichnode May 10, 2025
0bc6820
Merge pull request #8 from whichnode/update-api-container-image
whichnode May 10, 2025
e3c9db2
Pin chrono package to deal with their broken point release
whichnode May 11, 2025
469b436
Update lock file
whichnode May 11, 2025
ca8ab3f
Merge pull request #9 from whichnode/update-for-current-rust
whichnode May 11, 2025
26665fa
Fetch validator handles every hour
whichnode May 11, 2025
79f4d81
Merge pull request #10 from whichnode/fetch-validator-handles-often
whichnode May 11, 2025
eb9e7b3
Fetch account authorization status
whichnode May 11, 2025
58d5d37
Merge pull request #11 from whichnode/render-v8-account-status
whichnode May 11, 2025
91d4261
Use the right bit of account state
whichnode May 12, 2025
f366462
Merge pull request #12 from whichnode/render-v8-account-status
whichnode May 12, 2025
5d9bf3e
Render un-initialized accounts
whichnode May 12, 2025
2243f33
Merge pull request #13 from whichnode/render-v8-account-status
whichnode May 12, 2025
f2081b2
Add uninitialized account note
whichnode May 12, 2025
a9578c1
Fix unlocked balance displayed in validators table
whichnode May 12, 2025
6028529
Merge pull request #14 from whichnode/render-v8-account-status
whichnode May 12, 2025
7e8bab5
Fix compare
whichnode May 12, 2025
7e51f33
Merge pull request #15 from whichnode/render-v8-account-status
whichnode May 12, 2025
6333e02
Fix balance display for uninitialized accounts
whichnode May 14, 2025
05131d8
Merge pull request #16 from whichnode/fix-uninitialized-account-balances
whichnode May 14, 2025
a180d3f
Disable Accounts page until it displays correctly
whichnode May 19, 2025
f9a2427
Merge pull request #17 from whichnode/remove-accounts-page
whichnode May 19, 2025
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
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.80.1 as transformerBuilder
FROM rust:1-bookworm as transformerBuilder
WORKDIR /usr/src/myapp
COPY ./transformer .
RUN cargo install --path .
Expand Down
2 changes: 1 addition & 1 deletion api/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default (): Config => {
},

ol: {
provider: 'https://rpc.0l.fyi',
provider: ENV.RPC_PROVIDER_URL!,
dataApiHost: ENV.DATA_API_HOST!,
validatorHandlesUrl: ENV.VALIDATOR_HANDLES_URL || undefined,
communityWalletsUrl: ENV.COMMUNITY_WALLETS_URL || undefined,
Expand Down
9 changes: 4 additions & 5 deletions api/src/node-watcher/node-watcher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import { S3Service } from '../s3/s3.service.js';
import axios from 'axios';

const LEDGER_VERSION_LIMIT = 30n;
// Updated from https://github.com/petticur/seed-peers/blob/main/fullnode_seed_playlist.json
const DEFAULT_UPSTREAMS = [
'172.104.211.8',
'160.202.129.29',
'209.38.172.53',
'38.242.137.192',
'136.243.93.42',
'65.109.80.179',
'70.15.242.6',
'91.99.73.45',
'66.165.238.146',
];

@Injectable()
Expand Down
5 changes: 5 additions & 0 deletions api/src/ol/account.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export class AccountResolver {
return this.olService.getSlowWallet(account.address);
}

@ResolveField(() => Boolean, { nullable: true })
public async initialized(@Parent() account: Account): Promise<Boolean | null> {
return this.olService.getInitialized(account.address);
}

@ResolveField(() => PaginatedMovements)
public async movements(
@Parent() account: Account,
Expand Down
9 changes: 9 additions & 0 deletions api/src/ol/ol.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ export class OlService {
}
}

public async getInitialized(address: Uint8Array): Promise<boolean> {
const res = await this.aptosClient.view({
function: '0x1::activity::is_initialized',
type_arguments: [],
arguments: [`0x${Buffer.from(address).toString('hex')}`],
});
return res[0] as boolean;
}

public async getLatestStableVersion(): Promise<null | BN> {
const js = this.natsService.jetstream;
const kv = await js.views.kv('ol');
Expand Down
2 changes: 1 addition & 1 deletion api/src/ol/validators/validators.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class ValidatorsProcessor extends WorkerHost {

await this.validatorsQueue.add('updateValidatorsHandlersCache', undefined, {
repeat: {
every: 12 * 60 * 60 * 1000, // 12 hours
every: 1 * 60 * 60 * 1000, // 1 hour -- beware if this triggers github rate limits
},
});

Expand Down
4 changes: 3 additions & 1 deletion api/src/ol/validators/validators.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ export class ValidatorsService {
const balance = await this.olService.getAccountBalance(validator.address);
const currentBid = await this.olService.getCurrentBid(validator.address);
const slowWallet = await this.olService.getSlowWallet(validator.address);
const unlocked = Number(slowWallet?.unlocked);
// If we hit an uninitialized V7 slow wallet we need to override the unlocked balance as zero
const initialized = await this.olService.getInitialized(validator.address);
const unlocked = initialized ? Number(slowWallet?.unlocked) : Number(0);
const addr = validator.address.toString('hex').toLocaleUpperCase();
if (!handles.get(addr)) {
this.logger.debug(`handles miss for address ${addr}`)
Expand Down
1 change: 1 addition & 0 deletions api/src/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ type Account {
address: Bytes!
balance: Decimal
slowWallet: SlowWallet
reauthorized: Boolean!
movements(first: Int! = 10, after: String, order: OrderDirection! = ASC): PaginatedMovements!
}

Expand Down
Loading