SHA256
Починить импорт Arweave после ротации ключей
При восстановлении сегментированного fork импорт теперь чинит пустой blockchain_state до точки fork. Это позволяет t3 принять блоки нового ключа change01 после ротации.
This commit is contained in:
+3
-1
@@ -366,10 +366,11 @@ public final class ArweaveBlockSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ensureState(SolanaUserPdaCurrentEntry user, BchBlockEntry firstSeen) throws Exception {
|
private void ensureState(SolanaUserPdaCurrentEntry user, BchBlockEntry firstSeen) throws Exception {
|
||||||
BlockchainStateEntry existing=stateDAO.getByBlockchainName(user.getBlockchainName()); if(existing!=null)return;
|
|
||||||
int fork=forkOf(user.getBlockchainName()); BlockchainStateEntry s=new BlockchainStateEntry();
|
int fork=forkOf(user.getBlockchainName()); BlockchainStateEntry s=new BlockchainStateEntry();
|
||||||
s.setBlockchainName(user.getBlockchainName());s.setLogin(user.getLogin());s.setBlockchainKey(user.getBlockchainKey());s.setSizeLimit(user.getPaidLimitBytes()>0?user.getPaidLimitBytes():100_000L);s.setFileSizeBytes(0L);
|
s.setBlockchainName(user.getBlockchainName());s.setLogin(user.getLogin());s.setBlockchainKey(user.getBlockchainKey());s.setSizeLimit(user.getPaidLimitBytes()>0?user.getPaidLimitBytes():100_000L);s.setFileSizeBytes(0L);
|
||||||
BlockchainForkSegmentsDAO.Segment seg=segmentsDAO.get(user.getLogin(),fork);
|
BlockchainForkSegmentsDAO.Segment seg=segmentsDAO.get(user.getLogin(),fork);
|
||||||
|
BlockchainStateEntry existing=stateDAO.getByBlockchainName(user.getBlockchainName());
|
||||||
|
if(existing!=null && (seg==null || seg.parentForkNumber()==null || existing.getLastBlockNumber()>=seg.forkPointBlockNumber()))return;
|
||||||
if(seg!=null&&seg.parentForkNumber()!=null){
|
if(seg!=null&&seg.parentForkNumber()!=null){
|
||||||
s.setLastBlockNumber(seg.forkPointBlockNumber());s.setLastBlockHash(seg.forkPointBlockHash());
|
s.setLastBlockNumber(seg.forkPointBlockNumber());s.setLastBlockHash(seg.forkPointBlockHash());
|
||||||
try(var c=shine.db.DbController.getInstance().getConnection();var ps=c.prepareStatement("SELECT COALESCE(SUM(octet_length(block_bytes)),0) FROM blocks_store WHERE LOWER(login)=LOWER(?) AND block_number<=? AND fork_number=shine_canonical_fork(?,?,block_number)")){
|
try(var c=shine.db.DbController.getInstance().getConnection();var ps=c.prepareStatement("SELECT COALESCE(SUM(octet_length(block_bytes)),0) FROM blocks_store WHERE LOWER(login)=LOWER(?) AND block_number<=? AND fork_number=shine_canonical_fork(?,?,block_number)")){
|
||||||
@@ -377,6 +378,7 @@ public final class ArweaveBlockSyncService {
|
|||||||
}
|
}
|
||||||
} else{s.setLastBlockNumber(-1);s.setLastBlockHash(null);}
|
} else{s.setLastBlockNumber(-1);s.setLastBlockHash(null);}
|
||||||
s.setUpdatedAtMs(System.currentTimeMillis());stateDAO.insertIfMissing(s);
|
s.setUpdatedAtMs(System.currentTimeMillis());stateDAO.insertIfMissing(s);
|
||||||
|
if(existing!=null)stateDAO.upsert(s);
|
||||||
}
|
}
|
||||||
private static int forkOf(String n){int d=n.lastIndexOf('-');return Integer.parseInt(n.substring(d+1));}
|
private static int forkOf(String n){int d=n.lastIndexOf('-');return Integer.parseInt(n.substring(d+1));}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
client.version=1.14.9
|
client.version=1.14.9
|
||||||
server.version=1.12.7
|
server.version=1.12.8
|
||||||
|
|||||||
Reference in New Issue
Block a user