Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some nodes on testnet stopped syncing maybe caused by some modules #3296

Closed
dusmart opened this issue Jun 6, 2024 · 14 comments · Fixed by #3299
Closed

some nodes on testnet stopped syncing maybe caused by some modules #3296

dusmart opened this issue Jun 6, 2024 · 14 comments · Fixed by #3299

Comments

@dusmart
Copy link

dusmart commented Jun 6, 2024

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

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", "[email protected]")]
    [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);
        }
    }
}
@lingyido
Copy link
Contributor

lingyido commented Jun 6, 2024

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

@lingyido
Copy link
Contributor

lingyido commented Jun 6, 2024

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

@dusmart
Copy link
Author

dusmart commented Jun 6, 2024

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

@lock9
Copy link
Contributor

lock9 commented Jun 6, 2024

@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.

@roman-khimov
Copy link
Contributor

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.

@dusmart
Copy link
Author

dusmart commented Jun 7, 2024

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.

@superboyiii
Copy link
Member

@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.

@Jim8y Jim8y mentioned this issue Jun 7, 2024
14 tasks
@Jim8y Jim8y linked a pull request Jun 7, 2024 that will close this issue
14 tasks
@dusmart
Copy link
Author

dusmart commented Jun 7, 2024

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

@roman-khimov
Copy link
Contributor

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.

@dusmart
Copy link
Author

dusmart commented Jun 7, 2024

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.

@dusmart
Copy link
Author

dusmart commented Jun 7, 2024

"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.

@Jim8y
Copy link
Contributor

Jim8y commented Jun 7, 2024

"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.

@lingyido
Copy link
Contributor

lingyido commented Jun 7, 2024

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.

@Jim8y
Copy link
Contributor

Jim8y commented Jun 8, 2024

"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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants