Coder Social home page Coder Social logo

dice's Introduction

dice

https://i574n.github.io/dice

깃허브 코드스페이스

Build

pwsh scripts/init.ps1
pwsh scripts/build.ps1

Links

Code and Documentation


* Temporary README drafted with ChatGPT.

Updates

2024-02-08

Over the recent weeks, the development of the UI component of our repository has presented a multifaceted set of challenges, underscoring the intricate dance between advancing functionality, ensuring performance, and maintaining codebase integrity in the face of evolving requirements. This detailed assessment aims to shed light on the hurdles encountered, the methodologies employed to surmount them, and the lessons distilled from this endeavor.

The Challenge of State Management

At the heart of our UI development journey has been the sophisticated challenge of state management, particularly the integration and efficient handling of reactive state within the Leptos framework. The ambition to create a responsive, intuitive user interface necessitated a robust state management solution that could handle complex dependencies and asynchronous operations without sacrificing the reactivity or performance of the application.

The initial approach, leveraging a HashMap for caching with signals, aimed to optimize data retrieval and minimize unnecessary database interactions. However, this strategy introduced complexity, particularly in managing the lifecycle of reactive signals and ensuring data consistency across the application. The intricacies of signal management within Leptos—especially around nested updates and signal disposal—exposed potential pitfalls that could lead to inefficient update chains or, worse, application instability.

Transition to IndexedDB for Caching

In pursuit of a more scalable and maintainable approach, we pivoted to leveraging IndexedDB directly, treating each URL's data as an individual key for storage and retrieval. This method promised granular control over data management and the potential for improved performance on individual reads/writes. Yet, this transition was not without its trade-offs. The move towards a more decentralized caching mechanism necessitated a reevaluation of our data consistency strategies and introduced additional complexity in handling bulk operations and ensuring the freshness of the data served to the user.

Performance Considerations

A primary consideration throughout the UI development process has been performance. Each architectural decision, from the choice of caching mechanism to the structuring of reactive state, was evaluated not only on its immediate implications for development simplicity but also for its long-term impact on application responsiveness and efficiency. The challenge lay in balancing the desire for a dynamic, highly interactive user interface with the need to minimize latency, manage memory effectively, and ensure a seamless user experience across a wide range of devices and network conditions.

Rust's Type System and Ownership Model

Rust's type system and ownership model, designed to ensure memory safety and concurrency without a garbage collector, require that each value in Rust has a single owner and that at any given time, you can either have mutable or immutable references to a value, but not both. This model, while effective for preventing data races and memory leaks, introduces complexity when applied to reactive UI state management, where a piece of state may need to be accessed or updated from multiple points in the application.

Signal Management Complexity

Signals in UI development are used to represent reactive state—values that can change over time, with the UI automatically updating in response to these changes. Implementing this pattern in Rust involves managing lifetimes and mutability in a way that aligns with Rust's strict rules, which is non-trivial:

  • Mutable Access: Signals often need to be mutable so that they can be updated in response to user interactions or asynchronous operations. Rust's borrow checker ensures that only one mutable reference exists at a time, complicating scenarios where multiple components or functions need to update the state.
  • Ownership and Lifetimes: Signals representing UI state must live long enough to be accessible throughout the component lifecycle, requiring careful management of lifetimes and ownership, especially in dynamic UIs where components can be created and destroyed in response to user actions.

Asynchronous Operations and State

Modern UIs heavily rely on asynchronous operations—fetching data from a server, performing expensive computations in the background, etc. Integrating these operations with a reactive state in Rust involves dealing with futures and the borrow checker:

  • Concurrency and Safety: Rust's safety guarantees extend to asynchronous code, requiring that access to shared state across async boundaries be managed to prevent data races. This often necessitates additional synchronization primitives (e.g., mutexes), complicating state management.
  • Lifetime of Async Data: When data from asynchronous operations is bound to UI state, ensuring that the data's lifetime matches the UI components' lifecycle while satisfying Rust's lifetime requirements adds another layer of complexity.

Bridging Conceptual Models

The reactive programming model prevalent in UI development, characterized by dynamic state changes and automatic UI updates, contrasts with Rust's model, which emphasizes explicit state changes and manual UI redraws. Bridging these models requires a careful architectural design:

  • Event Handling and State Updates: Implementing an efficient and error-free event handling mechanism that translates user interactions into state updates according to Rust's rules.
  • State Propagation: Ensuring that changes to the state are efficiently propagated to the UI, triggering redraws where necessary, while minimizing unnecessary computations or updates.

Rust and Spiral

While compiling to Rust via Spiral brings the advantages of Rust's robust type system and ownership model to UI development, integrating these features with reactive state management and signals introduces inherent complexities. Managing mutable shared state, lifetimes, and asynchronous operations within Rust's strict safety constraints demands a deep understanding of both Rust's model and reactive programming principles. Addressing these challenges requires innovative solutions that bridge the conceptual gap between the reactive state in UIs and Rust's compile-time guarantees, ensuring both efficient application performance and developer ergonomics.

UI Evolution

Transitioning through the epochs of web development, from the era of PHP and jQuery to the modern landscape dominated by sophisticated client-side frameworks and advanced programming languages, encapsulates a journey of adaptation and evolution. PHP and jQuery, hallmarks of earlier web development phases, provided robust server-side processing and streamlined client-side scripting, respectively. These technologies laid the groundwork for web development, emphasizing simplicity in execution and a direct approach to handling HTTP requests, DOM manipulation, and event management.

The contemporary shift towards complex frameworks, reactive programming, and languages with strict type systems and ownership models, such as Rust, represents a paradigmatic shift. This transition is not merely a change in tools or languages but a fundamental rethinking of web application architecture—from monolithic pages to dynamic, component-driven single-page applications. It introduces a landscape where state management, real-time data synchronization, and modular development are paramount.

This evolution, while offering enhanced capabilities for creating rich, interactive user interfaces and efficient back-end services, also demands a broader skill set and a deeper understanding of both theoretical concepts and practical implementations. The emphasis on type safety, concurrency, and reactive state across both the client and server sides challenges developers to integrate disparate systems into cohesive, scalable applications.

For developers rooted in the traditional, the modern web development ecosystem offers both challenges and opportunities for growth. It invites a synthesis of established practices with emerging paradigms, fostering an environment where innovation is continuous, and learning is ongoing. In this context, the journey of web development is seen not as a series of obsolescences but as an expanding continuum where each phase contributes to the richness and complexity of the field.

Lessons Learned and Path Forward

This journey through the development of the UI component has been rich with lessons on the complexities of modern web development. It underscored the importance of clear state management patterns, the necessity of balancing innovation with practicality, and the value of continuous assessment and adaptation of our approaches in response to emerging challenges.

As we move forward, the experiences garnered from this phase of development will serve as a beacon, guiding future architectural and design decisions. The insights gained from grappling with state management complexities, performance optimization, and the intricacies of working with advanced web technologies will inform our continued efforts to refine and enhance the user interface.

In conclusion, the development of the UI component, while challenging, has been an invaluable crucible for innovation and learning. It has pushed the boundaries of our technical expertise, challenged our preconceptions, and ultimately led to a more sophisticated, resilient application architecture. As we continue to iterate and evolve our approach, we remain committed to delivering a user interface that is not only performant and feature-rich but also a joy to use.

This assessment, while highlighting the hurdles we've faced, also stands as a testament to the progress we've made and the unwavering dedication of our team to excellence. We look forward to sharing our continued journey with the community on GitHub and beyond.


Star History Chart

dice's People

Contributors

fc1943s avatar

Watchers

 avatar

dice's Issues

Optimizing Log Output for Enhanced Iteration Capacity in Smart Contract

Summary

We are experiencing an issue where our smart contract, which already incorporates batched operations due to pre-existing chain limits, produces log entries that exceed the permissible size of 16,384 characters during intensive operations, such as retrieving an on-chain random number. The current logging style and volume have been meticulously optimized, but we still encounter FunctionCallError due to log overflow. We seek to further refine our log output to increase the number of iterations before reaching the size limit, without compromising the detail necessary for effective monitoring and debugging.

ELI5 (Explain Like I'm 5)

Think of our smart contract like a reporter who needs to write about what happens in a sports game. The reporter has only a few pages in their notebook to summarize the most exciting parts of the game. If they write too much about the first half, they might not have enough space to cover what happens in the second half. We need to help our reporter pick the most important events to write about, so they can cover the whole game without running out of space.

Problem Details

Our smart contract already limits log outputs by batching operations, accommodating the blockchain's constraints on log entry sizes. However, during processes requiring multiple iterations to fetch random numbers, the volume of logs still surpasses the maximum allowed, leading to errors and halted transactions.

Desired Outcome

The objective is to refine our logging strategy to:

  • Ensure each log entry is concise yet sufficiently informative.
  • Allow additional iterations by optimizing the space each log consumes.
  • Maintain or enhance the ability to troubleshoot and debug the contract effectively.

Suggested Approaches

  1. Selective Logging: Enhance current conditional logging to further reduce output by focusing on critical states or errors, while summarizing routine operations more succinctly.
  2. Dynamic Log Verbosity: Implement dynamic verbosity levels that adjust based on the execution context or phase of contract interaction, increasing detail when closer to error conditions or critical operations.
  3. Structured Logging: Adopt a more structured logging format that reduces redundancy and focuses on key data points, potentially using a more compact encoding for repetitive data.
  4. Review and Optimize Existing Logs: Conduct a thorough review of current logs to identify and eliminate any unnecessary verbosity or redundancy without compromising the integrity and necessity of the information.

Request for Contributions

We encourage the community, especially those with experience in smart contract development and blockchain logging, to provide feedback, suggest optimizations, or contribute directly via pull requests. Your expertise can greatly assist in enhancing the efficiency and functionality of our logging system.

Additional Information

  • Smart Contract Platform: NEAR
  • Known Issues: Log size overflow during multiple iterative operations

2024-05-07_22-43
2024-05-07_22-18

near call luckier.near generate_random_number "{\`"key\`": \`"\`", \`"proof\`": \`"\`", \`"max\`": 2008}" --networkId mainnet --accountId i574n.near --gas 40000000000000
Scheduling a call: luckier.near.generate_random_number({"key": "", "proof": "", "max": 2008})
Receipt: 57my9sfiKMxTbke7vAeo11xZM41Rixb18mhVL7WC69VP
        Log [luckier.near]: contribute_seed / seed_excess: [86, 33, 254, 186, 222, 214, 6, 36, 219, 251, 62, 7, 37, 10, 157, 189, 165, 2, 58, 193, 9, 255, 22, 22, 76, 186, 124, 213, 238, 165, 157, 68, 3, 219, 211, 206, 97, 13, 117, 8, 130, 236, 54, 144, 21, 67, 25, 223, 170, 9, 162, 195, 23, 168, 212, 224, 57, 67, 37, 61, 124, 207, 224, 18]
        Log [luckier.near]: generate_random_number / max: 2008 / key: "" / proof: "" / block_timestamp: 1715134732640542873 / block_height: 118475369 / epoch_height: 2515 / account_balance: NearToken {
    inner: 3170920488517260100000000,
} / signer_account_id: "i574n.near"
 / seed: [155, 128, 202, 72, 77, 20, 99, 19, 136, 165, 126, 251, 249, 164, 247, 49, 203, 79, 107, 146, 141, 255, 184, 115, 220, 17, 225, 29, 124, 193, 193, 235]
 / entropy: [155, 128, 202, 72, 77, 20, 99, 19, 136, 165, 126, 251, 249, 164, 247, 49, 203, 79, 107, 146, 141, 255, 184, 115, 220, 17, 225, 29, 124, 193, 193, 235, 153, 96, 249, 192, 243, 97, 205, 23, 105, 202, 15, 7, 0, 0, 0, 0, 211, 9, 0, 0, 0, 0, 0, 0, 0, 89, 136, 99, 172, 241, 177, 241, 119, 159, 2, 0, 0, 0, 0, 0, 105, 53, 55, 52, 110, 46, 110, 101, 97, 114, 86, 33, 254, 186, 222, 214, 6, 36, 219, 251, 62, 7, 37, 10, 157, 189, 165, 2, 58, 193, 9, 255, 22, 22, 76, 186, 124, 213, 238, 165, 157, 68, 3, 219, 211, 206, 97, 13, 117, 8, 130, 236, 54, 144, 21, 67, 25, 223, 170, 9, 162, 195, 23, 168, 212, 224, 57, 67, 37, 61, 124, 207, 224, 18, 143, 224, 237, 70, 165, 131, 48, 211, 185, 188, 90, 61, 40, 251, 195, 31, 98, 233, 124, 21, 176, 105, 164, 104, 5, 41, 205, 153, 81, 176, 146, 16, 93, 237, 21, 99]
 / hash_u8: [96, 163, 123, 209, 74, 16, 207, 182, 226, 191, 224, 20, 186, 94, 76, 50, 212, 177, 227, 17, 222, 22, 199, 174, 63, 64, 17, 197, 245, 158, 192, 92, 111, 11, 173, 49, 76, 179, 143, 48, 52, 172, 186, 75, 202, 115, 31, 249, 86, 228, 240, 243, 246, 29, 102, 215, 21, 251, 15, 150, 99, 190, 91, 220]
 / rolls_list: [6, 1, 3, 5, 2, 4, 3, 2, 4, 5, 2, 2, 6, 4, 4, 2, 2, 3, 5, 5, 6, 4, 1, 6, 3, 4, 5, 5, 5, 2, 6, 2, 3, 5, 5, 1, 4, 5, 5, 6, 4, 4, 6, 3, 4, 1, 1, 3, 2, 6, 6, 3, 6, 5, 6, 5, 3, 5, 3, 6, 3, 4, 1, 4]
        Log [luckier.near]: create_sequential_roller ()
calculate_dice_count / max: 2008 / n: 5 / p: 7776
create_sequential_roller / roll / current_index: 0 / acc: 1 / len: -1 / last_item: US2_0
create_sequential_roller / roll / current_index: 1 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 2 / acc: 1 / len: -1 / last_item: US2_1(1)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 3 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 4 / acc: 1 / len: -1 / last_item: US2_1(5)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 2 / value: 1296
accumulate_dice_rolls / power: 3 / acc: 1296 / roll: 5 / value: 864
accumulate_dice_rolls / power: 2 / acc: 2160 / roll: 3 / value: 72
accumulate_dice_rolls / power: 1 / acc: 2232 / roll: 1
        Log [luckier.near]: accumulate_dice_rolls / power: 0 / acc: 2232 / roll: 6 / value: 5
accumulate_dice_rolls / power: -1 / acc: 2237 / result: 2238
create_sequential_roller / roll / current_index: 5 / acc: 1 / len: -1 / last_item: US2_1(2)
create_sequential_roller / roll / current_index: 6 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 7 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 8 / acc: 1 / len: -1 / last_item: US2_1(2)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 9 / acc: 1 / len: -1 / last_item: US2_1(4)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 5 / value: 5184
accumulate_dice_rolls / power: 3 / acc: 5184 / roll: 4 / value: 648
accumulate_dice_rolls / power: 2 / acc: 5832 / roll: 3 / value: 72
accumulate_dice_rolls / power: 1 / acc: 5904 / roll: 2 / value: 6
accumulate_dice_rolls / power: 0 / acc: 5910 / roll: 4 / value: 3
        Log [luckier.near]: accumulate_dice_rolls / power: -1 / acc: 5913 / result: 5914
create_sequential_roller / roll / current_index: 10 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 11 / acc: 1 / len: -1 / last_item: US2_1(2)
create_sequential_roller / roll / current_index: 12 / acc: 1 / len: -1 / last_item: US2_1(2)
create_sequential_roller / roll / current_index: 13 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 14 / acc: 1 / len: -1 / last_item: US2_1(4)
        Log [luckier.near]: accumulate_dice_rolls / power: 4 / acc: 0 / roll: 4 / value: 3888
accumulate_dice_rolls / power: 3 / acc: 3888 / roll: 2 / value: 216
accumulate_dice_rolls / power: 2 / acc: 4104 / roll: 2 / value: 36
accumulate_dice_rolls / power: 1 / acc: 4140 / roll: 6 / value: 30
accumulate_dice_rolls / power: 0 / acc: 4170 / roll: 4 / value: 3
accumulate_dice_rolls / power: -1 / acc: 4173 / result: 4174
        Log [luckier.near]: create_sequential_roller / roll / current_index: 15 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 16 / acc: 1 / len: -1 / last_item: US2_1(2)
create_sequential_roller / roll / current_index: 17 / acc: 1 / len: -1 / last_item: US2_1(2)
create_sequential_roller / roll / current_index: 18 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 19 / acc: 1 / len: -1 / last_item: US2_1(5)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 5 / value: 5184
        Log [luckier.near]: accumulate_dice_rolls / power: 3 / acc: 5184 / roll: 2 / value: 216
accumulate_dice_rolls / power: 2 / acc: 5400 / roll: 2 / value: 36
accumulate_dice_rolls / power: 1 / acc: 5436 / roll: 3 / value: 12
accumulate_dice_rolls / power: 0 / acc: 5448 / roll: 5 / value: 4
accumulate_dice_rolls / power: -1 / acc: 5452 / result: 5453
create_sequential_roller / roll / current_index: 20 / acc: 1 / len: -1 / last_item: US2_1(5)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 21 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 22 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 23 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 24 / acc: 1 / len: -1 / last_item: US2_1(6)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 3 / value: 2592
accumulate_dice_rolls / power: 3 / acc: 2592 / roll: 6 / value: 1080
        Log [luckier.near]: accumulate_dice_rolls / power: 2 / acc: 3672 / roll: 4 / value: 108
accumulate_dice_rolls / power: 1 / acc: 3780 / roll: 1
accumulate_dice_rolls / power: 0 / acc: 3780 / roll: 6 / value: 5
accumulate_dice_rolls / power: -1 / acc: 3785 / result: 3786
create_sequential_roller / roll / current_index: 25 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 26 / acc: 1 / len: -1 / last_item: US2_1(4)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 27 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 28 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 29 / acc: 1 / len: -1 / last_item: US2_1(5)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 2 / value: 1296
accumulate_dice_rolls / power: 3 / acc: 1296 / roll: 4 / value: 648
accumulate_dice_rolls / power: 2 / acc: 1944 / roll: 5 / value: 144
        Log [luckier.near]: accumulate_dice_rolls / power: 1 / acc: 2088 / roll: 5 / value: 24
accumulate_dice_rolls / power: 0 / acc: 2112 / roll: 5 / value: 4
accumulate_dice_rolls / power: -1 / acc: 2116 / result: 2117
create_sequential_roller / roll / current_index: 30 / acc: 1 / len: -1 / last_item: US2_1(2)
create_sequential_roller / roll / current_index: 31 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 32 / acc: 1 / len: -1 / last_item: US2_1(2)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 33 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 34 / acc: 1 / len: -1 / last_item: US2_1(5)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 5 / value: 5184
accumulate_dice_rolls / power: 3 / acc: 5184 / roll: 6 / value: 1080
accumulate_dice_rolls / power: 2 / acc: 6264 / roll: 2 / value: 36
accumulate_dice_rolls / power: 1 / acc: 6300 / roll: 3 / value: 12
        Log [luckier.near]: accumulate_dice_rolls / power: 0 / acc: 6312 / roll: 5 / value: 4
accumulate_dice_rolls / power: -1 / acc: 6316 / result: 6317
create_sequential_roller / roll / current_index: 35 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 36 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 37 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 38 / acc: 1 / len: -1 / last_item: US2_1(5)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 39 / acc: 1 / len: -1 / last_item: US2_1(5)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 6 / value: 6480
accumulate_dice_rolls / power: 3 / acc: 6480 / roll: 1
accumulate_dice_rolls / power: 2 / acc: 6480 / roll: 4 / value: 108
accumulate_dice_rolls / power: 1 / acc: 6588 / roll: 5 / value: 24
accumulate_dice_rolls / power: 0 / acc: 6612 / roll: 5 / value: 4
        Log [luckier.near]: accumulate_dice_rolls / power: -1 / acc: 6616 / result: 6617
create_sequential_roller / roll / current_index: 40 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 41 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 42 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 43 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 44 / acc: 1 / len: -1 / last_item: US2_1(3)
        Log [luckier.near]: accumulate_dice_rolls / power: 4 / acc: 0 / roll: 4 / value: 3888
accumulate_dice_rolls / power: 3 / acc: 3888 / roll: 4 / value: 648
accumulate_dice_rolls / power: 2 / acc: 4536 / roll: 4 / value: 108
accumulate_dice_rolls / power: 1 / acc: 4644 / roll: 6 / value: 30
accumulate_dice_rolls / power: 0 / acc: 4674 / roll: 3 / value: 2
accumulate_dice_rolls / power: -1 / acc: 4676 / result: 4677
        Log [luckier.near]: create_sequential_roller / roll / current_index: 45 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 46 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 47 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 48 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 49 / acc: 1 / len: -1 / last_item: US2_1(2)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 6 / value: 6480
        Log [luckier.near]: accumulate_dice_rolls / power: 3 / acc: 6480 / roll: 1
accumulate_dice_rolls / power: 2 / acc: 6480 / roll: 1
accumulate_dice_rolls / power: 1 / acc: 6480 / roll: 3 / value: 12
accumulate_dice_rolls / power: 0 / acc: 6492 / roll: 2 / value: 1
accumulate_dice_rolls / power: -1 / acc: 6493 / result: 6494
create_sequential_roller / roll / current_index: 50 / acc: 1 / len: -1 / last_item: US2_1(6)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 51 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 52 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 53 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 54 / acc: 1 / len: -1 / last_item: US2_1(5)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 6 / value: 6480
accumulate_dice_rolls / power: 3 / acc: 6480 / roll: 6 / value: 1080
        Log [luckier.near]: accumulate_dice_rolls / power: 2 / acc: 7560 / roll: 3 / value: 72
accumulate_dice_rolls / power: 1 / acc: 7632 / roll: 6 / value: 30
accumulate_dice_rolls / power: 0 / acc: 7662 / roll: 5 / value: 4
accumulate_dice_rolls / power: -1 / acc: 7666 / result: 7667
create_sequential_roller / roll / current_index: 55 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 56 / acc: 1 / len: -1 / last_item: US2_1(5)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 57 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 58 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 59 / acc: 1 / len: -1 / last_item: US2_1(3)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 6 / value: 6480
accumulate_dice_rolls / power: 3 / acc: 6480 / roll: 5 / value: 864
accumulate_dice_rolls / power: 2 / acc: 7344 / roll: 3 / value: 72
        Log [luckier.near]: accumulate_dice_rolls / power: 1 / acc: 7416 / roll: 5 / value: 24
accumulate_dice_rolls / power: 0 / acc: 7440 / roll: 3 / value: 2
accumulate_dice_rolls / power: -1 / acc: 7442 / result: 7443
create_sequential_roller / roll / current_index: 60 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 61 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 62 / acc: 1 / len: -1 / last_item: US2_1(4)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 63 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 64 / acc: 1 / len: -1 / last_item: US2_1(4)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 4 / value: 3888
accumulate_dice_rolls / power: 3 / acc: 3888 / roll: 3 / value: 432
accumulate_dice_rolls / power: 2 / acc: 4320 / roll: 4 / value: 108
accumulate_dice_rolls / power: 1 / acc: 4428 / roll: 1
        Log [luckier.near]: accumulate_dice_rolls / power: 0 / acc: 4428 / roll: 4 / value: 3
accumulate_dice_rolls / power: -1 / acc: 4431 / result: 4432
create_sequential_roller / roll / current_index: 65 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 66 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 67 / acc: 1 / len: -1 / last_item: US2_1(4)
create_sequential_roller / roll / current_index: 68 / acc: 1 / len: -1 / last_item: US2_1(3)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 69 / acc: 1 / len: -1 / last_item: US2_1(6)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 3 / value: 2592
accumulate_dice_rolls / power: 3 / acc: 2592 / roll: 1
accumulate_dice_rolls / power: 2 / acc: 2592 / roll: 4 / value: 108
accumulate_dice_rolls / power: 1 / acc: 2700 / roll: 3 / value: 12
accumulate_dice_rolls / power: 0 / acc: 2712 / roll: 6 / value: 5
        Log [luckier.near]: accumulate_dice_rolls / power: -1 / acc: 2717 / result: 2718
create_sequential_roller / roll / current_index: 70 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 71 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 72 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 73 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 74 / acc: 1 / len: -1 / last_item: US2_1(6)
        Log [luckier.near]: accumulate_dice_rolls / power: 4 / acc: 0 / roll: 5 / value: 5184
accumulate_dice_rolls / power: 3 / acc: 5184 / roll: 5 / value: 864
accumulate_dice_rolls / power: 2 / acc: 6048 / roll: 3 / value: 72
accumulate_dice_rolls / power: 1 / acc: 6120 / roll: 5 / value: 24
accumulate_dice_rolls / power: 0 / acc: 6144 / roll: 6 / value: 5
accumulate_dice_rolls / power: -1 / acc: 6149 / result: 6150
        Log [luckier.near]: create_sequential_roller / roll / current_index: 75 / acc: 1 / len: -1 / last_item: US2_1(5)
create_sequential_roller / roll / current_index: 76 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 77 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 78 / acc: 1 / len: -1 / last_item: US2_1(6)
create_sequential_roller / roll / current_index: 79 / acc: 1 / len: -1 / last_item: US2_1(6)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 2 / value: 1296
        Log [luckier.near]: accumulate_dice_rolls / power: 3 / acc: 1296 / roll: 6 / value: 1080
accumulate_dice_rolls / power: 2 / acc: 2376 / roll: 3 / value: 72
accumulate_dice_rolls / power: 1 / acc: 2448 / roll: 6 / value: 30
accumulate_dice_rolls / power: 0 / acc: 2478 / roll: 6 / value: 5
accumulate_dice_rolls / power: -1 / acc: 2483 / result: 2484
create_sequential_roller / roll / current_index: 80 / acc: 1 / len: -1 / last_item: US2_1(2)
        Log [luckier.near]: create_sequential_roller / roll / current_index: 81 / acc: 1 / len: -1 / last_item: US2_1(3)
create_sequential_roller / roll / current_index: 82 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 83 / acc: 1 / len: -1 / last_item: US2_1(1)
create_sequential_roller / roll / current_index: 84 / acc: 1 / len: -1 / last_item: US2_1(4)
accumulate_dice_rolls / power: 4 / acc: 0 / roll: 3 / value: 2592
accumulate_dice_rolls / power: 3 / acc: 2592 / roll: 3 / value: 432
        Failure [luckier.near]: Error: {"index":0,"kind":{"index":0,"kind":{"FunctionCallError":{"ExecutionError":"The length of a log message 16786 exceeds the limit 16384"}}}}
near call <contractName> <methodName> [args]

Call method in smart contract

Options:
      --help                            Show help  [boolean]
      --version                         Show version number  [boolean]
  -v, --verbose                         Prints out verbose output  [boolean] [default: false]
      --useAccount, --accountId         Account that will execute the actions  [string] [required]
      --signWithLedger, --useLedgerKey  Use Ledger for signing  [boolean] [default: false]
      --ledgerPath                      HD key path  [string] [default: "44'/397'/0'/0'/1'"]
      --networkId                       Which network to use. Supports: mainnet, testnet, custom  [string] [default: "testnet"]
      --gas                             Max amount of gas this call can use (in gas units)  [string] [default: 30000000000000]
      --deposit, --amount               Number of tokens to attach (in NEAR) to a function call  [string] [default: "0"]
      --depositYocto                    Number of tokens to attach (in yocto NEAR) to a function call  [string] [default: null]
      --base64                          Treat arguments as base64-encoded BLOB.  [boolean] [default: false]
      --privateKey                      AccessKey to use in the call  [string] [default: null]

ServerTransactionError: {"index":0,"kind":{"index":0,"kind":{"FunctionCallError":{"ExecutionError":"The length of a log message 16786 exceeds the limit 16384"}}}}
    at parseResultError (C:\Users\i574n\scoop\persist\nvm\nodejs\v21.7.2\node_modules\near-cli\node_modules\@near-js\utils\lib\errors\rpc_errors.js:31:29)
    at Account.<anonymous> (C:\Users\i574n\scoop\persist\nvm\nodejs\v21.7.2\node_modules\near-cli\node_modules\@near-js\accounts\lib\account.js:123:56)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\i574n\scoop\persist\nvm\nodejs\v21.7.2\node_modules\near-cli\node_modules\@near-js\accounts\lib\account.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
{
  type: 'ActionError',
  context: undefined,
  index: 0,
  kind: { index: 0, kind: { FunctionCallError: [Object] } },
  transaction_outcome: {
    block_hash: '5eEFzeJnXuceDgfLspiYTqWtNNjCCmn1MAgXh6mZp92q',
    id: 'FHusD6X34CvFhN42r9z8P7mUKn3APutjsraFTtzwBeRx',
    outcome: {
      executor_id: 'i574n.near',
      gas_burnt: 308180240436,
      logs: [],
      metadata: [Object],
      receipt_ids: [Array],
      status: [Object],
      tokens_burnt: '30818024043600000000'
    },
    proof: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ]
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.