Skip to content

Conversation

@benaadams
Copy link
Member

Changes

  • Use existing array for precompile result, when Memory array backed and size same

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • No

public (ReadOnlyMemory<byte>, bool) Run(in ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec)
{
return (inputData, true);
return (inputData.ToArray(), true);
Copy link
Member Author

Choose a reason for hiding this comment

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

Not enturely sure why, but IdentityPrecompile isn't really used so shouldn't really matter

@benaadams benaadams requested a review from LukaszRozmej May 8, 2024 23:09
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

Also would it be better to be bool TryRun(in ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec, out ReadOnlyMemory<byte> result) ?

@benaadams
Copy link
Member Author

Also would it be better to be bool TryRun(in ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec, out ReadOnlyMemory<byte> result) ?

More of a break if another chain has their own precompiles? (Don't know if they do)

@LukaszRozmej
Copy link
Member

LukaszRozmej commented May 9, 2024

Also would it be better to be bool TryRun(in ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec, out ReadOnlyMemory<byte> result) ?

More of a break if another chain has their own precompiles? (Don't know if they do)

huh why? I am askung about just changing interface, bool can go via register, or the whole tuple goes via registers?

@benaadams
Copy link
Member Author

Also would it be better to be bool TryRun(in ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec, out ReadOnlyMemory<byte> result) ?

More of a break if another chain has their own precompiles? (Don't know if they do)

huh why? I am askung about just changing interface, bool can go via register, or the whole tuple goes via registers?

I mean if any existing extenal precompiles/plugin as they would need to change their signiture to upgrade?

@benaadams
Copy link
Member Author

Would be a better signiture though :)

@benaadams benaadams merged commit 632dc71 into master May 9, 2024
@benaadams benaadams deleted the precompile branch May 9, 2024 14:40
@LukaszRozmej
Copy link
Member

Also would it be better to be bool TryRun(in ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec, out ReadOnlyMemory<byte> result) ?

More of a break if another chain has their own precompiles? (Don't know if they do)

huh why? I am askung about just changing interface, bool can go via register, or the whole tuple goes via registers?

I mean if any existing extenal precompiles/plugin as they would need to change their signiture to upgrade?

I don't think there are any, and if yes this is trivial change

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.

3 participants