最全面的开源工具,用于监控 Solana 钱包活动、检测余额变化、跟踪潜在内幕交易以及接收 SOL 和所有 SPL 代币的实时警报。
https://accursedgalaxy.github.io/Insider-Monitor/
https://github.com/AccursedGalaxy/Insider-Monitor
最全面的开源工具,用于监控 Solana 钱包活动、检测余额变化、跟踪潜在内幕交易以及接收 SOL 和所有 SPL 代币的实时警报。
https://accursedgalaxy.github.io/Insider-Monitor/
https://github.com/AccursedGalaxy/Insider-Monitor
使用 upgrades.erc1967.getImplementationAddress 来获取通过 upgrades.deployProxy 部署的合约的逻辑合约地址(implementation address)
const [deployer] = await ethers.getSigners();
console.log("Deployer:", await deployer.getAddress())
const commonBridgeFactory = await ethers.getContractFactory("CommonBridge", deployer);
let commonBridgeProxyContract;
if (deployOutput.commonBridgeProxyContract === undefined || deployOutput.commonBridgeProxyContract === '') {
commonBridgeProxyContract = await upgrades.deployProxy(
commonBridgeFactory,
[
process.env.DOMAIN_ID,
process.env.SUPER_ADMIN_ADDRESS,
process.env.BRIDGE_FEE_ADDRESS
],
{
constructorArgs: [],
unsafeAllow: ['constructor', 'state-variable-immutable'],
});
console.log('tx hash:', commonBridgeProxyContract.deploymentTransaction().hash);
} else {
commonBridgeProxyContract = commonBridgeFactory.attach(deployOutput.commonBridgeProxyContract);
}
console.log('commonBridgeProxyContract deployed to:', commonBridgeProxyContract.target);
await sleep(6000);
const commonBridgeImpl = await upgrades.erc1967.getImplementationAddress(commonBridgeProxyContract.target);
console.log('commonBridgeProxyContract implementation deployed to:', commonBridgeImpl);
Error: Timed out waiting for implementation contract deployment to address 0x5393... with transaction 0x9492...
解决:增加超时和轮询设置
...
commonBridgeProxyContract = await upgrades.deployProxy(
commonBridgeFactory,
[
process.env.DOMAIN_ID,
process.env.SUPER_ADMIN_ADDRESS,
process.env.BRIDGE_FEE_ADDRESS
],
{
constructorArgs: [],
unsafeAllow: ['constructor', 'state-variable-immutable'],
timeout: 300000, // 5分钟
pollingInterval: 5000, // 每5秒轮询一次
});
console.log('tx hash:', commonBridgeProxyContract.deploymentTransaction().hash);
...
使用 upgrades.erc1967.getImplementationAddress 来获取通过 upgrades.deployProxy 部署的合约的逻辑合约地址(implementation address),结果报:部署地址不符合 ERC1967 标准的代理合约(Proxy)
Error: Contract at 0xffa5f716D890CFd4f9D709A40d6EB7Fb19fC43B4 doesn't look like an ERC 1967 proxy with a logic contract address
const implSlot = '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc';
const proxyAddress = '0xffa5f716D890CFd4f9D709A40d6EB7Fb19fC43B4';
const storage = await ethers.provider.getStorage(proxyAddress, implSlot);
console.log("Raw implementation slot:", storage);
const implAddress = '0x' + storage.slice(-40);
console.log("Implementation address:", implAddress);
const implAddress1 = await upgrades.erc1967.getImplementationAddress(proxyAddress);
console.log("Implementation address1:", implAddress1);
如果返回的 implStorage 是全零(0x000...),说明实现地址确实没有写进去,可能部署时失败或未初始化。
如果你用其他方式部署 Proxy(比如自己 new TransparentUpgradeableProxy,而不是用 upgrades.deployProxy()),OpenZeppelin 插件就不能保证你用了它支持的初始化逻辑。
解决: 是因为网络延迟原因,增加延迟时间
console.log('commonBridgeProxyContract deployed to:', commonBridgeProxyContract.target);
await sleep(20000); // 提高延迟间隔
const commonBridgeImpl = await upgrades.erc1967.getImplementationAddress(commonBridgeProxyContract.target);
console.log('commonBridgeProxyContract implementation deployed to:', commonBridgeImpl);
const [deployer] = await ethers.getSigners();
console.log("Deployer:", await deployer.getAddress())
const commonBridgeFactory = await ethers.getContractFactory("CommonBridge", deployer);
let commonBridgeProxyContract;
if (deployOutput.commonBridgeProxyContract === undefined || deployOutput.commonBridgeProxyContract === '') {
commonBridgeProxyContract = await upgrades.deployProxy(
commonBridgeFactory,
[
process.env.DOMAIN_ID,
process.env.SUPER_ADMIN_ADDRESS,
process.env.BRIDGE_FEE_ADDRESS
],
{
constructorArgs: [],
unsafeAllow: ['constructor', 'state-variable-immutable'],
timeout: 300000,
pollingInterval: 5000,
});
console.log('tx hash:', commonBridgeProxyContract.deploymentTransaction().hash);
} else {
commonBridgeProxyContract = commonBridgeFactory.attach(deployOutput.commonBridgeProxyContract);
}
console.log('commonBridgeProxyContract deployed to:', commonBridgeProxyContract.target);
await sleep(20000);
const commonBridgeImpl = await upgrades.erc1967.getImplementationAddress(commonBridgeProxyContract.target);
console.log('commonBridgeProxyContract implementation deployed to:', commonBridgeImpl);FULL v0、Cursor、Manus、Same.dev、Lovable、Devin、Replit Agent、Windsurf Agent、VSCode Agent、Dia Browser、Trae AI 和 Cluely(以及其他开源)系统提示、工具和 AI 模型。
github: https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools
当交易上链后,需要websocket尽快订阅到新发起的交易信息,但已有逻辑有2s左右延迟
{
"jsonrpc": "2.0",
"id": 1,
"method": "blockSubscribe",
"params": [
{ },
{ "commitment": "finalized" }
]
}
当前测试环境为私有网络,且仅有一个Validator
结果:链路优化后,延迟优化效果不明显
排除:排除WAF设置或防护逻辑,以及RPC同步相关对websocket的影响
修改blockSubscribe.commitment 参数
| 测试参数 | 最大延迟 | 概率 | 备注 |
|---|---|---|---|
| blockSubscribe (confirmed) | < 1s | 95% | 满足实时需求 |
| blockSubscribe (finalized) | ~ 2s | 均值 |
RPC节点需开启
--rpc-pubsub-enable-block-subscription
总结:当blockSubscribe.commitment 为confirmed时,满足实时性需求
下面继续做具体分析,以及安全性确认
Solana 分别引入了 processed、confirmed 和 finalized 三种 commitment
| Commitment 等级 | 状态说明 | 是否可能回滚 | 用途 |
|---|---|---|---|
processed |
当前 leader 节点已执行交易(未确认) | 可能被 fork | 快速响应 |
confirmed |
超过 1 个 superminority(2/3 vote)节点已投票确认 | 小概率回滚(如果 fork 被重组) | 较安全且快速 |
finalized |
已不可逆地写入链上(root slot) | 永不回滚 | 最终状态 |
Solana 是基于 Turbine + Tower BFT 共识 的区块链,允许 fork 存在,直到达成“supermajority lockout”:
tx1 达到 confirmed这种情况虽然极少发生(除非网络分叉非常激烈),但确实有可能,尤其在以下情况下:
结论:如果整个网络只有一个 validator,交易一旦被执行(即 processed),就等同于 finalized,不会被回滚或丢弃
原因:Solana 的分叉和回滚机制依赖于 多个 validator 的投票(tower consensus),但如果你只有一个 validator 节点(如私链或测试环境):
问题:在只有一个 Validator 的 Solana 网络中,为什么交易已经 confirmed,但还没有立即 finalized?不是说没有其他节点就没有分叉吗?
原因:因为 finalized 状态取决于 root slot 的推进,而 root slot 的推进有“延迟”或“惰性机制”,即使只有一个 validator。
Solana 的 finalized 并不是单纯根据是否有分叉来判断,而是依赖一个特殊机制:
finalizedfinalized| 机制 | 描述 |
|---|---|
| lockout period | Tower BFT 规定,validator 必须投票到一定深度才可推进 root |
| skip slot 会阻碍 | 如果出现 skipped slot(空块),会延迟 root 推进 |
| 安全考虑 | 即使是单节点,仍沿用同样安全逻辑,避免不同部署模式产生不一致行为 |
假设你只有一个 validator,slot 时间 400ms:
processedconfirmedfinalized所以即使没有其他 validator,
finalized仍然比confirmed晚 2~4 个 slot(~1.5 秒)



填入私有链对应的RPC,链ID 随意 (对于Solana链没有链ID,这里只是为了与EVM链类型共用布局)

只做演示,BCSkill 技术社区未对外提供私有Solana链支持

然后回到资产展示,选择新添加的网络即可

不要直接从 系统设置->节点列表->选择Solana->添加自定义节点
这里的添加只能添加Solana官方的节点,添加时会通过RPC 获取getGenesisHash,得到创世hash并与Solana 官方devnet testnet mainnet 进行比对,如果不一致则报错。
应该先添加完自定义网络后,再给自定义网络添加自定义节点
