neo-project / neo

NEO Smart Economy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

some nodes on testnet stopped syncing maybe caused by some modules

dusmart opened this issue · comments

Describe the bug

When I'm developing new contracts and wants to see the GAS consumed on testnet. Some nodes are stopped.

2 explorers stopped syncing, only onegate lives now.

To Reproduce

send a tx like this https://testmagnet.explorer.onegate.space/transactionInfo/0xd73b99b222151ddab5891023a705adc450c5779ab25bb225a7b8f9871ffdd16a.

Expected behavior

Normal end.

Screenshots

Screenshot 2024-06-06 at 22 09 33

Platform:

  • Version 3.7.4
  • Node Type C#

(Optional) Additional context

  • The contracts' code before stopped syncing is in details.
  • Calling the main with parameter 100 will give you a 3.2MB result by RpcServer plugin.
  • I suspect that it's caused by some plugins based on previous experience #2666.
using System;
using System.ComponentModel;
using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Attributes;
using Neo.SmartContract.Framework.Services;

namespace bigevent
{
    [DisplayName("bigevent")]
    [ManifestExtra("Author", "NEO")]
    [ManifestExtra("Email", "developer@neo.org")]
    [ManifestExtra("Description", "This is a bigevent")]
    public class bigevent : SmartContract
    {
        public static ByteString[] ns = new ByteString[]{"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};

        public static event SyncedEvent Synced;
        public delegate void SyncedEvent(ByteString[] ns);

        public static void Update(ByteString nefFile, string manifest) {
            Neo.SmartContract.Framework.Native.ContractManagement.Update(nefFile, manifest, null);
        }

        public static Notification[] Main(int i)
        {
            while (i > 0) {
                Synced(ns);
                i--;
            }
            return Runtime.GetNotifications(Runtime.ExecutingScriptHash);
        }
    }
}

FYI. My C# testnet node 3.7.4 with only leveldb plugin installed works and syncs well.

LOL. You're doing bad experiments. AoAaBgABLAESwB8MBG1haW4MFFMo9Cc1/EJCiUOG1Ow0/ZfStZoXQWJ9W1I= script cost me 5 minutes and 16_68745493 datoshi on my PC.

I suggest that some seed nodes and explorer nodes on testnet to uninstall unnecessary modules.

IIRC, testnet's GAS fee factor is 1/3 compared to mainnet now, which means that the script could cost only ~50 GAS on mainnet. It's a failed experiments. @lingyido

@dusmart The fees are different, but I'm not sure if they should:

neoxp policy get -r https://testnet1.neo.coz.io
             GasPerBlock: 500000000 (5 GAS)
    MinimumDeploymentFee: 1000000000 (10 GAS)
CandidateRegistrationFee: 100000000000 (1000 GAS)
        OracleRequestFee: 10000000 (0.1 GAS)
       NetworkFeePerByte: 20 (0.0000002 GAS)
        StorageFeeFactor: 1000
      ExecutionFeeFactor: 1
neoxp policy get -r https://mainnet1.neo.coz.io
             GasPerBlock: 500000000 (5 GAS)
    MinimumDeploymentFee: 1000000000 (10 GAS)
CandidateRegistrationFee: 100000000000 (1000 GAS)
        OracleRequestFee: 10000000 (0.1 GAS)
       NetworkFeePerByte: 100 (0.000001 GAS)
        StorageFeeFactor: 10000
      ExecutionFeeFactor: 3

Shouldn't both networks have the same parameters? @roman-khimov I remember you saying something about this but I can't find where.

I suggest that some seed nodes and explorer nodes on testnet to uninstall unnecessary modules.

Likely it's not even possible for explorer nodes (they need application logs and RPC). And I always expect seed nodes to have almost all plugins.

AoAaBgABLAESwB8MBG1haW4MFFMo9Cc1/EJCiUOG1Ow0/ZfStZoXQWJ9W1I= script cost me 5 minutes

$ time curl -sd '{ "jsonrpc": "2.0", "id": 5, "method": "invokescript", "params": ["AoAaBgABLAESwB8MBG1haW4MFFMo9Cc1/EJCiUOG1Ow0/ZfStZoXQWJ9W1I="] }' https://rpc.t5.n3.nspcc.ru:20331 >/dev/null

real    0m2,814s
user    0m0,058s
sys     0m0,052s

Shouldn't both networks have the same parameters?

I guess testnet was updated with newer proposed parameters some time ago.

Likely it's not even possible for explorer nodes (they need application logs and RPC).

Then they're the necessary part. I mean to uninstall those unnecessary one.

And I always expect seed nodes to have almost all plugins.

Then one buggy plugin could cause such a damage. 2/3 of the explorer stopped syncing now and a lot of wallet with default rpc settings stopped now.

I suppose that maybe letting 1/5 install 1/5 part unnecessary plugins and other 1/5 install others is better.

$ time curl -sd '{ "jsonrpc": "2.0", "id": 5, "method": "invokescript", "params": ["AoAaBgABLAESwB8MBG1haW4MFFMo9Cc1/EJCiUOG1Ow0/ZfStZoXQWJ9W1I="] }' https://rpc.t5.n3.nspcc.ru:20331 >/dev/null

Your node is so fast. Have you compare that if the result is same between C# and golang? It seems that two type of nodes cost different amount of GAS.

commented

@dusmart The fees are different, but I'm not sure if they should:

neoxp policy get -r https://testnet1.neo.coz.io
             GasPerBlock: 500000000 (5 GAS)
    MinimumDeploymentFee: 1000000000 (10 GAS)
CandidateRegistrationFee: 100000000000 (1000 GAS)
        OracleRequestFee: 10000000 (0.1 GAS)
       NetworkFeePerByte: 20 (0.0000002 GAS)
        StorageFeeFactor: 1000
      ExecutionFeeFactor: 1
neoxp policy get -r https://mainnet1.neo.coz.io
             GasPerBlock: 500000000 (5 GAS)
    MinimumDeploymentFee: 1000000000 (10 GAS)
CandidateRegistrationFee: 100000000000 (1000 GAS)
        OracleRequestFee: 10000000 (0.1 GAS)
       NetworkFeePerByte: 100 (0.000001 GAS)
        StorageFeeFactor: 10000
      ExecutionFeeFactor: 3

Shouldn't both networks have the same parameters? @roman-khimov I remember you saying something about this but I can't find where.

It's a new proposal made by council on testnet to reduce fees. We're testing on it.

LOL. You're doing bad experiments. AoAaBgABLAESwB8MBG1haW4MFFMo9Cc1/EJCiUOG1Ow0/ZfStZoXQWJ9W1I= script cost me 5 minutes and 16_68745493 datoshi on my PC.

@lingyido here comes the bad one #3300

Then one buggy plugin could cause such a damage

Sure. But who needs a node without plugins? CNs? There are a few of those. Everyone else needs at least RPC and application logs, otherwise it's a useless node that can't be used for dApp development. So if you have a problem in any of those plugins it's exactly that for users --- "broken node, please fix it". No one cares if it's a plugin, it's an essential thing for most users.

But who needs a node without plugins?

We have multiple seed nodes. Each can have a set of unnecessary plugins. Users can use different functions from different nodes. At least, let some of the seed nodes live when an unimportant plugin breaks.

"broken node, please fix it". No one cares if it's a plugin, it's an essential thing for most users.

Yeap. When some plugins breaks, if we could let the wallets and explorers works as usual, it would be better. We surely need to fix any official plugins. But it's not necessary to break so many tools. I have to express my appreciation to onegate here. They didn't stuck at all at this time.

I'm not sure how onegate managed to survive when the ApplicationLog plugins break. But it shows that ApplicationLog is not as important as the core node itself.

"broken node, please fix it". No one cares if it's a plugin, it's an essential thing for most users.

Yeap. When some plugins breaks, if we could let the wallets and explorers works as usual, it would be better. We surely need to fix any official plugins. But it's not necessary to break so many tools. I have to express my appreciation to onegate here. They didn't stuck at all at this time.

I'm not sure how onegate managed to survive when the ApplicationLog plugins break. But it shows that ApplicationLog is not as important as the core node itself.

i am working to run each plugin in seperate process.

This is a reason why I only install leveldb and my own plugins. And my node worked well, by the way. You can try your own node like me.

"broken node, please fix it". No one cares if it's a plugin, it's an essential thing for most users.

Yeap. When some plugins breaks, if we could let the wallets and explorers works as usual, it would be better. We surely need to fix any official plugins. But it's not necessary to break so many tools. I have to express my appreciation to onegate here. They didn't stuck at all at this time.
I'm not sure how onegate managed to survive when the ApplicationLog plugins break. But it shows that ApplicationLog is not as important as the core node itself.

i am working to run each plugin in seperate process.

Easier and efficient solution now available here #3309. Seperate process will take longer.