Skip to content

Single chain node#549

Merged
lmoe merged 26 commits into
developfrom
single_chain_node
Apr 3, 2025
Merged

Single chain node#549
lmoe merged 26 commits into
developfrom
single_chain_node

Conversation

@lmoe
Copy link
Copy Markdown
Collaborator

@lmoe lmoe commented Mar 15, 2025

This disables cross-chain requests and therefore eases the statedb ChainID key requirements.
This also turns ISC into a single node chain, with the option to quickly fall back to the past behavior if required.

Comment thread packages/isc/agentid.go Outdated
Comment thread packages/isc/agentid.go
Comment thread packages/isc/agentid.go Outdated
Comment thread packages/isc/request_evmcall.go Outdated
Comment on lines 89 to 92
func (req *evmOffLedgerCallRequest) TargetAddress() *cryptolib.Address {
return req.chainID.AsAddress()
return cryptolib.NewEmptyAddress()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look good. Maybe the TargetAddress method should be removed from the Request interface

Comment on lines -173 to -179
// if the caller contract is on the same chain the transfer would end up
// in the same L2 account it is taken from, so we do nothing in that case
if callerContract.ChainID().Equals(ctx.ChainID()) {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callerContract.ChainID().Equals(ctx.ChainID()) is true for single chain node 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the whole entry point transferAccountToChain, since it uses cross-chain requests

func TestSerdeRequestReceipt(t *testing.T) {
nonce := uint64(time.Now().UnixNano())
req := isc.NewOffLedgerRequest(isctest.RandomChainID(), isc.NewMessage(isc.Hn("0"), isc.Hn("0")), nonce, gas.LimitsDefault.MaxGasPerRequest)
req := isc.NewOffLedgerRequest(isc.EmptyChainID(), isc.NewMessage(isc.Hn("0"), isc.Hn("0")), nonce, gas.LimitsDefault.MaxGasPerRequest)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why this change?

Comment thread packages/vm/core/governance/internal.go
Comment thread packages/vm/vmimpl/send.go Outdated
Comment thread packages/vm/vmimpl/send.go Outdated
Comment on lines -173 to -179
// if the caller contract is on the same chain the transfer would end up
// in the same L2 account it is taken from, so we do nothing in that case
if callerContract.ChainID().Equals(ctx.ChainID()) {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the whole entry point transferAccountToChain, since it uses cross-chain requests

@lmoe lmoe marked this pull request as ready for review March 31, 2025 16:42
@lmoe lmoe merged commit 61643e8 into develop Apr 3, 2025
@lmoe lmoe deleted the single_chain_node branch April 3, 2025 10:32
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 this pull request may close these issues.

2 participants